diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 4a5919edf0..373bc9b2e3 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -109,5 +109,16 @@ (match-string 0 s)) "a")))) +(ert-deftest rx-kleene-empty-string () + ;; Test whether the repetition of empty string --that matches everywhere-- is handled correctly + (should (string-match (rx (zero-or-more "")) "foo")) + (should (string-match (rx (one-or-more "")) "foo"))) + +(ert-deftest rx-kleene-unmatchable () + ;; Test whether the repetition of regexp-unmatchable is handled correctly + (should (string-match (rx (zero-or-more (or))) "foo")) + (should-not (string-match (rx (or)) "foo")) + (should-not (string-match (rx (one-or-more (or))) "+"))) + (provide 'rx-tests) ;; rx-tests.el ends here.