diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2020-11-09 17:11:05 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2020-11-09 17:28:37 +0100 |
commit | 575b0681d926463960fc00d1e33decaa71d5c956 (patch) | |
tree | 4b20bdde66789d734928c5dbda08f01c752eb765 /test/lisp/emacs-lisp/rx-tests.el | |
parent | 52937958064223bec3ad518363d3cc50d995b259 (diff) | |
download | emacs-575b0681d926463960fc00d1e33decaa71d5c956.tar.gz emacs-575b0681d926463960fc00d1e33decaa71d5c956.tar.bz2 emacs-575b0681d926463960fc00d1e33decaa71d5c956.zip |
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.el | 6 |
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." |