From 87475f4af21daf8a09f08e359a22c33e0173f3ee Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Sun, 4 Dec 2022 15:20:49 +0100 Subject: 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. --- test/lisp/emacs-lisp/rx-tests.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/lisp/emacs-lisp/rx-tests.el') 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") -- cgit v1.2.3