diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/rx-tests.el | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index e14feda347f..fa3d9b0d5ea 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el | |||
| @@ -92,5 +92,18 @@ | |||
| 92 | (*? "e") (+? "f") (\?? "g") (?? "h")))) | 92 | (*? "e") (+? "f") (\?? "g") (?? "h")))) |
| 93 | "a*b+c?d?e*?f+?g??h??"))) | 93 | "a*b+c?d?e*?f+?g??h??"))) |
| 94 | 94 | ||
| 95 | (ert-deftest rx-or () | ||
| 96 | ;; Test or-pattern reordering (Bug#34641). | ||
| 97 | (let ((s "abc")) | ||
| 98 | (should (equal (and (string-match (rx (or "abc" "ab" "a")) s) | ||
| 99 | (match-string 0 s)) | ||
| 100 | "abc")) | ||
| 101 | (should (equal (and (string-match (rx (or "ab" "abc" "a")) s) | ||
| 102 | (match-string 0 s)) | ||
| 103 | "ab")) | ||
| 104 | (should (equal (and (string-match (rx (or "a" "ab" "abc")) s) | ||
| 105 | (match-string 0 s)) | ||
| 106 | "a")))) | ||
| 107 | |||
| 95 | (provide 'rx-tests) | 108 | (provide 'rx-tests) |
| 96 | ;; rx-tests.el ends here. | 109 | ;; rx-tests.el ends here. |