summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 028250b7352..9c8628a8f26 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -112,23 +112,33 @@
(should (equal (rx (any "]" "^") (any "]" "-") (any "-" "^")
(not (any "]" "^")) (not (any "]" "-"))
(not (any "-" "^")))
- "[]^][]-][-^][^]^][^]-][^-^]"))
+ "[]^][]-][-^][^]^][^]-][^^-]"))
(should (equal (rx (any "]" "^" "-") (not (any "]" "^" "-")))
"[]^-][^]^-]"))
+ (should (equal (rx (any "^-f") (any "^-f" "-")
+ (any "^-f" "z") (any "^-f" "z" "-"))
+ "[_-f^][_-f^-][_-f^z][_-f^z-]"))
+ (should (equal (rx (not (any "^-f")) (not (any "^-f" "-"))
+ (not (any "^-f" "z")) (not (any "^-f" "z" "-")))
+ "[^^-f][^^-f-][^^-fz][^^-fz-]"))
+ (should (equal (rx (any "^-f" word) (any "^-f" "-" word))
+ "[_-f^[:word:]][_-f^[:word:]-]"))
+ (should (equal (rx (not (any "^-f" word)) (not (any "^-f" "-" word)))
+ "[^^-f[:word:]][^^-f[:word:]-]"))
(should (equal (rx (any "-" ascii) (any "^" ascii) (any "]" ascii))
"[[:ascii:]-][[:ascii:]^][][:ascii:]]"))
(should (equal (rx (not (any "-" ascii)) (not (any "^" ascii))
(not (any "]" ascii)))
- "[^[:ascii:]-][^[:ascii:]^][^][:ascii:]]"))
+ "[^[:ascii:]-][^^[:ascii:]][^][:ascii:]]"))
(should (equal (rx (any "-]" ascii) (any "^]" ascii) (any "-^" ascii))
"[][:ascii:]-][]^[:ascii:]][[:ascii:]^-]"))
(should (equal (rx (not (any "-]" ascii)) (not (any "^]" ascii))
(not (any "-^" ascii)))
- "[^][:ascii:]-][^]^[:ascii:]][^[:ascii:]^-]"))
+ "[^][:ascii:]-][^]^[:ascii:]][^^[:ascii:]-]"))
(should (equal (rx (any "-]^" ascii) (not (any "-]^" ascii)))
"[]^[:ascii:]-][^]^[:ascii:]-]"))
(should (equal (rx (any "^" lower upper) (not (any "^" lower upper)))
- "[[:lower:]^[:upper:]][^[:lower:]^[:upper:]]"))
+ "[[:lower:]^[:upper:]][^^[:lower:][:upper:]]"))
(should (equal (rx (any "-" lower upper) (not (any "-" lower upper)))
"[[:lower:][:upper:]-][^[:lower:][:upper:]-]"))
(should (equal (rx (any "]" lower upper) (not (any "]" lower upper)))
@@ -143,7 +153,7 @@
"[]-a-][^]-a-]"))
(should (equal (rx (any "--]") (not (any "--]"))
(any "-" "^-a") (not (any "-" "^-a")))
- "[].-\\-][^].-\\-][-^-a][^-^-a]"))
+ "[].-\\-][^].-\\-][_-a^-][^^-a-]"))
(should (equal (rx (not (any "!a" "0-8" digit nonascii)))
"[^!0-8a[:digit:][:nonascii:]]"))
(should (equal (rx (any) (not (any)))