aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index ef2541d83af..4ecc805aead 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -268,7 +268,9 @@
268 (should (equal (rx (not (syntax punctuation)) (not (syntax escape))) 268 (should (equal (rx (not (syntax punctuation)) (not (syntax escape)))
269 "\\S.\\S\\")) 269 "\\S.\\S\\"))
270 (should (equal (rx (not (category tone-mark)) (not (category lao))) 270 (should (equal (rx (not (category tone-mark)) (not (category lao)))
271 "\\C4\\Co"))) 271 "\\C4\\Co"))
272 (should (equal (rx (not (not ascii)) (not (not (not (any "a-z")))))
273 "[[:ascii:]][^a-z]")))
272 274
273(ert-deftest rx-group () 275(ert-deftest rx-group ()
274 (should (equal (rx (group nonl) (submatch "x") 276 (should (equal (rx (group nonl) (submatch "x")
@@ -404,6 +406,19 @@
404 (should-error (rx-let-eval '((not-char () "x")) nil)) 406 (should-error (rx-let-eval '((not-char () "x")) nil))
405 (should-error (rx-let-eval '((not-char "x")) nil))) 407 (should-error (rx-let-eval '((not-char "x")) nil)))
406 408
409(ert-deftest rx-def-in-not ()
410 "Test definition expansion inside (not ...)."
411 (rx-let ((a alpha)
412 (b (not hex))
413 (c (not (category base)))
414 (d (x) (any ?a x ?z))
415 (e (x) (syntax x))
416 (f (not b)))
417 (should (equal (rx (not a) (not b) (not c) (not f))
418 "[^[:alpha:]][[:xdigit:]]\\c.[^[:xdigit:]]"))
419 (should (equal (rx (not (d ?m)) (not (e symbol)))
420 "[^amz]\\S_"))))
421
407(ert-deftest rx-constituents () 422(ert-deftest rx-constituents ()
408 (let ((rx-constituents 423 (let ((rx-constituents
409 (append '((beta . gamma) 424 (append '((beta . gamma)