From e7a326fff98fdc56b91818af526d398d8387bda4 Mon Sep 17 00:00:00 2001 From: Max Nikulin Date: Wed, 21 Apr 2021 19:22:18 +0700 Subject: [PATCH 2/3] testing/lisp/test-org.el: Non-obvious cases for org-sort-remove-invisible testing/lisp/test-org.el (test-org/org-sort-remove-invisible): Add test cases illustrating corner cases in parser behavior. Fontification in Emacs buffer is not consistent with result of `org-sort-remove-invisible` for 2 of 3 added examples. The intention is to make author of changes in parser aware of consequences, however it is unlikely that users rely on such nuances. Update expectations if change is considered as improvement. --- testing/lisp/test-org.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index 3f74b3f35..4f987f509 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -8283,7 +8283,18 @@ two ("*Wrap [[https:/orgmode.org][link]] emphasis*" . "Wrap link emphasis") ("A =verbatim [[https://orgmode.org/][link]] example=" . - "A verbatim [[https://orgmode.org/][link]] example"))) + "A verbatim [[https://orgmode.org/][link]] example") + ;; A bit strange cases to catch changes of behavior. + ;; It may be reasonable to update expectation in the case of failure. + ("/Overlapping [[http://orgmode.org][structure/ with link]]" . + ;; not "Overlapping structure with link" + "Overlapping [[http://orgmode.org][structure with link]]") + ("Another [[http://orgmode.org][overlapping *structure]] with* link" . + ;; not "Another overlapping structure with link" + "Another overlapping *structure with* link") + ("A /wrapping [[https://orgmode.org/?bot=true][link]] emphasis/" . + ;; not "A wrapping link emphasis", lost "/" before "?" instead + "A wrapping [[https://orgmode.org?bot=true][link]] emphasis/"))) (let ((test-string (car case)) (expectation (cdr case))) (should (equal expectation (org-sort-remove-invisible test-string)))))) -- 2.25.1