summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/rx-tests.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2022-12-04 15:20:49 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2022-12-11 16:49:06 +0100
commit87475f4af21daf8a09f08e359a22c33e0173f3ee (patch)
tree449e5f6d6e4d91052285de49e2be60b8d29c38d9 /test/lisp/emacs-lisp/rx-tests.el
parent4893a15631743e1d885bd09b9184bc112c7eadcb (diff)
downloademacs-87475f4af21daf8a09f08e359a22c33e0173f3ee.tar.gz
emacs-87475f4af21daf8a09f08e359a22c33e0173f3ee.tar.bz2
emacs-87475f4af21daf8a09f08e359a22c33e0173f3ee.zip
Fix pcase rx patterns using rx-let bindings (bug#59814)
Reported by Daniel Pittman. * lisp/emacs-lisp/rx.el (rx): Move binding of rx--local-definitions... (rx--to-expr): ...here. * test/lisp/emacs-lisp/rx-tests.el (rx-let-pcase): New test.
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 125ddee8595..01772e54d8a 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -207,6 +207,12 @@
(list 'ok z))
'(ok "F"))))
+(ert-deftest rx-let-pcase ()
+ "Test `rx-let' around `pcase' with `rx' patterns (bug#59814)."
+ (should (equal (rx-let ((tata "ab"))
+ (pcase "abc" ((rx tata) 'toto)))
+ 'toto)))
+
(ert-deftest rx-kleene ()
"Test greedy and non-greedy repetition operators."
(should (equal (rx (* "a") (+ "b") (\? "c") (?\s "d")