Move a test

* testing/lisp/test-org-macs.el (test-org/in-regexp): Moved from...
* testing/lisp/test-org.el: ... here.
This commit is contained in:
Nicolas Goaziou 2017-10-24 09:55:49 +02:00
parent 96c7fd7541
commit 1b9a66487a
2 changed files with 37 additions and 33 deletions

View File

@ -19,6 +19,8 @@
;;; Code: ;;; Code:
;;; String manipulation
(ert-deftest test-org/split-string () (ert-deftest test-org/split-string ()
"Test `org-split-string' specifications." "Test `org-split-string' specifications."
@ -70,6 +72,41 @@
(org-string-display (org-string-display
#("123" 1 2 (display "abc" face foo))))))) #("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) (provide 'test-org-macs)
;;; test-org-macs.el ends here ;;; test-org-macs.el ends here

View File

@ -2711,39 +2711,6 @@ http://article.gmane.org/gmane.emacs.orgmode/21459/"
;;; Miscellaneous ;;; 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 () (ert-deftest test-org/sort-entries ()
"Test `org-sort-entries'." "Test `org-sort-entries'."
;; Sort alphabetically. ;; Sort alphabetically.