summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-11-09 17:11:05 +0100
committerEli Zaretskii <eliz@gnu.org>2020-11-09 18:59:24 +0200
commit78e1646bf7bde8f00c196319f4803e98460d506a (patch)
treedf9ff3a595c356760fb22029ebf718f607ac4c72 /test
parent75384bd1555feca0ba11948ed71e4b557b8da59f (diff)
downloademacs-78e1646bf7bde8f00c196319f4803e98460d506a.tar.gz
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. (cherry picked from commit 575b0681d926463960fc00d1e33decaa71d5c956)
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 0fece4004bd..05779b4e0a6 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -158,7 +158,11 @@
(let ((k "blue"))
(should (equal (pcase "<blue>"
((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."