aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 344f46764c8..a82f1f83645 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -272,7 +272,9 @@
272 (should (equal (rx (not (category tone-mark)) (not (category lao))) 272 (should (equal (rx (not (category tone-mark)) (not (category lao)))
273 "\\C4\\Co")) 273 "\\C4\\Co"))
274 (should (equal (rx (not (not ascii)) (not (not (not (any "a-z"))))) 274 (should (equal (rx (not (not ascii)) (not (not (not (any "a-z")))))
275 "[[:ascii:]][^a-z]"))) 275 "[[:ascii:]][^a-z]"))
276 (should (equal (rx (not ?a) (not "b") (not (not "c")) (not (not ?d)))
277 "[^a][^b]cd")))
276 278
277(ert-deftest rx-charset-or () 279(ert-deftest rx-charset-or ()
278 (should (equal (rx (or)) 280 (should (equal (rx (or))
@@ -294,13 +296,17 @@
294 "[a-ru-z]")) 296 "[a-ru-z]"))
295 (should (equal (rx (or (intersection (any "c-z") (any "a-g")) 297 (should (equal (rx (or (intersection (any "c-z") (any "a-g"))
296 (not (any "a-k")))) 298 (not (any "a-k"))))
297 "[^abh-k]"))) 299 "[^abh-k]"))
300 (should (equal (rx (or ?f (any "b-e") "a") (not (or ?x "y" (any "s-w"))))
301 "[a-f][^s-y]")))
298 302
299(ert-deftest rx-def-in-charset-or () 303(ert-deftest rx-def-in-charset-or ()
300 (rx-let ((a (any "badc")) 304 (rx-let ((a (any "badc"))
301 (b (| a (any "def")))) 305 (b (| a (any "def")))
302 (should (equal (rx (or b (any "q"))) 306 (c ?a)
303 "[a-fq]"))) 307 (d "b"))
308 (should (equal (rx (or b (any "q")) (or c d))
309 "[a-fq][ab]")))
304 (rx-let ((diff-| (a b) (not (or (not a) b)))) 310 (rx-let ((diff-| (a b) (not (or (not a) b))))
305 (should (equal (rx (diff-| (any "a-z") (any "gr"))) 311 (should (equal (rx (diff-| (any "a-z") (any "gr")))
306 "[a-fh-qs-z]")))) 312 "[a-fh-qs-z]"))))
@@ -326,7 +332,9 @@
326 "[e-m]")) 332 "[e-m]"))
327 (should (equal (rx (intersection (or (any "a-f") (any "f-t")) 333 (should (equal (rx (intersection (or (any "a-f") (any "f-t"))
328 (any "e-w"))) 334 (any "e-w")))
329 "[e-t]"))) 335 "[e-t]"))
336 (should (equal (rx (intersection ?m (any "a-z") "m"))
337 "m")))
330 338
331(ert-deftest rx-def-in-intersection () 339(ert-deftest rx-def-in-intersection ()
332 (rx-let ((a (any "a-g")) 340 (rx-let ((a (any "a-g"))