summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/rx-tests.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2021-02-26 19:54:59 +0100
committerAndrea Corallo <akrl@sdf.org>2021-02-26 19:54:59 +0100
commit5c922cc3a4b0677805a678267df2b7598e92bb83 (patch)
treef7680e085436621332230c7a46df36ad4048310b /test/lisp/emacs-lisp/rx-tests.el
parentcedc55041ea5179dcb389845d2d0e3562060cab9 (diff)
parent496fa1c03b1b3ce4aa9872751e9fac45167766c2 (diff)
downloademacs-5c922cc3a4b0677805a678267df2b7598e92bb83.tar.gz
emacs-5c922cc3a4b0677805a678267df2b7598e92bb83.tar.bz2
emacs-5c922cc3a4b0677805a678267df2b7598e92bb83.zip
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 12bf4f7978e..fecdcf55aff 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -171,7 +171,17 @@
(should (equal (pcase "abc"
((rx (? (let x alpha)) (?? (let y alnum)) ?c)
(list x y)))
- '("a" "b"))))
+ '("a" "b")))
+ (should (equal (pcase 'not-a-string
+ ((rx nonl) 'wrong)
+ (_ 'correct))
+ 'correct))
+ (should (equal (pcase-let (((rx ?B (let z nonl)) "ABC"))
+ (list 'ok z))
+ '(ok "C")))
+ (should (equal (pcase-let* (((rx ?E (let z nonl)) "DEF"))
+ (list 'ok z))
+ '(ok "F"))))
(ert-deftest rx-kleene ()
"Test greedy and non-greedy repetition operators."