summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2019-12-03 15:17:37 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2019-12-03 15:17:37 +0100
commita6b598518c4bf6dfc587cfb2b61fa5fb04b99494 (patch)
tree53a5dd14398ff04282ff98f7e97f4560b3f84b58 /test/lisp/emacs-lisp
parenta05bafffdcb88df74408a8402cafc9829407c1e5 (diff)
downloademacs-a6b598518c4bf6dfc587cfb2b61fa5fb04b99494.tar.gz
emacs-a6b598518c4bf6dfc587cfb2b61fa5fb04b99494.tar.bz2
emacs-a6b598518c4bf6dfc587cfb2b61fa5fb04b99494.zip
Avoid duplicated character classes in rx
For example, (any digit digit) should produce "[[:digit:]]", not "[[:digit:][:digit:]]". * lisp/emacs-lisp/rx.el (rx--translate-any): Deduplicate character classes. * test/lisp/emacs-lisp/rx-tests.el (rx-any): Add test case.
Diffstat (limited to 'test/lisp/emacs-lisp')
-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 4ecc805aead..26e39f8c8ed 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -128,7 +128,9 @@
(should (equal (rx (any) (not (any)))
"\\`a\\`[^z-a]"))
(should (equal (rx (any "") (not (any "")))
- "\\`a\\`[^z-a]")))
+ "\\`a\\`[^z-a]"))
+ (should (equal (rx (any space ?a digit space))
+ "[a[:space:][:digit:]]")))
(ert-deftest rx-pcase ()
(should (equal (pcase "a 1 2 3 1 1 b"