summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/rx-tests.el
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-11-09 17:11:05 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-11-09 17:28:37 +0100
commit575b0681d926463960fc00d1e33decaa71d5c956 (patch)
tree4b20bdde66789d734928c5dbda08f01c752eb765 /test/lisp/emacs-lisp/rx-tests.el
parent52937958064223bec3ad518363d3cc50d995b259 (diff)
downloademacs-575b0681d926463960fc00d1e33decaa71d5c956.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.
Diffstat (limited to 'test/lisp/emacs-lisp/rx-tests.el')
-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 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 "<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."