|
@@ -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
|