summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-24 09:55:49 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-24 09:55:49 +0200
commit1b9a66487a868e0172ec9b598a8b0aa6c4abdd4a (patch)
tree00bf2b373c4d2561dfab82b3b29ac02962f300e9
parent96c7fd754186f8cd8b9a0b2abf251a0962740586 (diff)
downloadorg-mode-1b9a66487a868e0172ec9b598a8b0aa6c4abdd4a.tar.gz
Move a test
* testing/lisp/test-org-macs.el (test-org/in-regexp): Moved from... * testing/lisp/test-org.el: ... here.
-rw-r--r--testing/lisp/test-org-macs.el37
-rw-r--r--testing/lisp/test-org.el33
2 files changed, 37 insertions, 33 deletions
diff --git a/testing/lisp/test-org-macs.el b/testing/lisp/test-org-macs.el
index 7c54761..438e871 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 ab<point>c xx"
+ (org-in-regexp "abc")))
+ (should-not
+ (org-test-with-temp-text "xx abc <point>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 ab<point>c xx"
+ (org-in-regexp "abc")))
+ ;; With optional argument NLINES, check extra lines around point.
+ (should-not
+ (org-test-with-temp-text "A\nB<point>\nC"
+ (org-in-regexp "A\nB\nC")))
+ (should
+ (org-test-with-temp-text "A\nB<point>\nC"
+ (org-in-regexp "A\nB\nC" 1)))
+ (should-not
+ (org-test-with-temp-text "A\nB\nC<point>"
+ (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<point> xx"
+ (org-in-regexp "abc")))
+ (should-not
+ (org-test-with-temp-text "xx abc<point> 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 f94079b..379ded6 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 ab<point>c xx"
- (org-in-regexp "abc")))
- (should-not
- (org-test-with-temp-text "xx abc <point>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 ab<point>c xx"
- (org-in-regexp "abc")))
- ;; With optional argument NLINES, check extra lines around point.
- (should-not
- (org-test-with-temp-text "A\nB<point>\nC"
- (org-in-regexp "A\nB\nC")))
- (should
- (org-test-with-temp-text "A\nB<point>\nC"
- (org-in-regexp "A\nB\nC" 1)))
- (should-not
- (org-test-with-temp-text "A\nB\nC<point>"
- (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<point> xx"
- (org-in-regexp "abc")))
- (should-not
- (org-test-with-temp-text "xx abc<point> xx"
- (org-in-regexp "abc" nil t))))
-
(ert-deftest test-org/sort-entries ()
"Test `org-sort-entries'."
;; Sort alphabetically.