From 575b0681d926463960fc00d1e33decaa71d5c956 Mon Sep 17 00:00:00 2001 From: Mattias EngdegÄrd Date: Mon, 9 Nov 2020 17:11:05 +0100 Subject: Fix pcase rx form snag with '?' and '??' (bug#44532) This is a regression from Emacs 26. Reported by Phillip Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case. --- test/lisp/emacs-lisp/rx-tests.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/lisp/emacs-lisp') diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 59d8c600a20..91b0884d4a9 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -167,7 +167,11 @@ (let ((k "blue")) (should (equal (pcase "" ((rx "<" (literal k) ">") 'ok)) - 'ok)))) + 'ok))) + (should (equal (pcase "abc" + ((rx (? (let x alpha)) (?? (let y alnum)) ?c) + (list x y))) + '("a" "b")))) (ert-deftest rx-kleene () "Test greedy and non-greedy repetition operators." -- cgit v1.2.3