summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-03-05 12:49:26 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-03-05 12:55:54 +0100
commit1814c7e158685045278f991de5eba4e40e8c8199 (patch)
treed5410f610b70f28207b617bfb793067d36808207 /test
parent40fb20061e6b9b2b22aeee5b7e9f038dc9ba843b (diff)
downloademacs-1814c7e158685045278f991de5eba4e40e8c8199.tar.gz
Fix rx error with ? and ??
The ? and ?? rx operators are special in that they can be written as characters (space and '?' respectively). This confused the definition look-up mechanism in rare cases. * lisp/emacs-lisp/rx.el (rx--expand-def): Don't look up non-symbols. * test/lisp/emacs-lisp/rx-tests.el (rx-charset-or): Test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 4888e1d9d1e..0fece4004bd 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -316,7 +316,9 @@
(should (equal (rx (not (or (in "abc") (char "bcd"))))
"[^a-d]"))
(should (equal (rx (or (not (in "abc")) (not (char "bcd"))))
- "[^bc]")))
+ "[^bc]"))
+ (should (equal (rx (or "x" (? "yz")))
+ "x\\|\\(?:yz\\)?")))
(ert-deftest rx-def-in-charset-or ()
(rx-let ((a (any "badc"))