From 1b9a66487a868e0172ec9b598a8b0aa6c4abdd4a Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 24 Oct 2017 09:55:49 +0200 Subject: [PATCH] Move a test * testing/lisp/test-org-macs.el (test-org/in-regexp): Moved from... * testing/lisp/test-org.el: ... here. --- testing/lisp/test-org-macs.el | 37 +++++++++++++++++++++++++++++++++++ testing/lisp/test-org.el | 33 ------------------------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/testing/lisp/test-org-macs.el b/testing/lisp/test-org-macs.el index 7c54761d6..438e8712f 100644 --- a/testing/lisp/test-org-macs.el +++ b/testing/lisp/test-org-macs.el @@ -19,6 +19,8 @@ ;;; Code: + +;;; String manipulation (ert-deftest test-org/split-string () "Test `org-split-string' specifications." @@ -70,6 +72,41 @@ (org-string-display #("123" 1 2 (display "abc" face foo))))))) + +;;; Regexp + +(ert-deftest test-org/in-regexp () + "Test `org-in-regexp' specifications." + ;; Standard tests. + (should + (org-test-with-temp-text "xx abc xx" + (org-in-regexp "abc"))) + (should-not + (org-test-with-temp-text "xx abc xx" + (org-in-regexp "abc"))) + ;; Return non-nil even with multiple matching regexps in the same + ;; line. + (should + (org-test-with-temp-text "abc xx abc xx" + (org-in-regexp "abc"))) + ;; With optional argument NLINES, check extra lines around point. + (should-not + (org-test-with-temp-text "A\nB\nC" + (org-in-regexp "A\nB\nC"))) + (should + (org-test-with-temp-text "A\nB\nC" + (org-in-regexp "A\nB\nC" 1))) + (should-not + (org-test-with-temp-text "A\nB\nC" + (org-in-regexp "A\nB\nC" 1))) + ;; When optional argument VISUALLY is non-nil, return nil if at + ;; regexp boundaries. + (should + (org-test-with-temp-text "xx abc xx" + (org-in-regexp "abc"))) + (should-not + (org-test-with-temp-text "xx abc xx" + (org-in-regexp "abc" nil t)))) (provide 'test-org-macs) ;;; test-org-macs.el ends here diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index f94079b7e..379ded672 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -2711,39 +2711,6 @@ http://article.gmane.org/gmane.emacs.orgmode/21459/" ;;; Miscellaneous -(ert-deftest test-org/in-regexp () - "Test `org-in-regexp' specifications." - ;; Standard tests. - (should - (org-test-with-temp-text "xx abc xx" - (org-in-regexp "abc"))) - (should-not - (org-test-with-temp-text "xx abc xx" - (org-in-regexp "abc"))) - ;; Return non-nil even with multiple matching regexps in the same - ;; line. - (should - (org-test-with-temp-text "abc xx abc xx" - (org-in-regexp "abc"))) - ;; With optional argument NLINES, check extra lines around point. - (should-not - (org-test-with-temp-text "A\nB\nC" - (org-in-regexp "A\nB\nC"))) - (should - (org-test-with-temp-text "A\nB\nC" - (org-in-regexp "A\nB\nC" 1))) - (should-not - (org-test-with-temp-text "A\nB\nC" - (org-in-regexp "A\nB\nC" 1))) - ;; When optional argument VISUALLY is non-nil, return nil if at - ;; regexp boundaries. - (should - (org-test-with-temp-text "xx abc xx" - (org-in-regexp "abc"))) - (should-not - (org-test-with-temp-text "xx abc xx" - (org-in-regexp "abc" nil t)))) - (ert-deftest test-org/sort-entries () "Test `org-sort-entries'." ;; Sort alphabetically.