diff options
| author | Mattias EngdegÄrd | 2019-12-03 15:17:37 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-12-03 15:17:37 +0100 |
| commit | a6b598518c4bf6dfc587cfb2b61fa5fb04b99494 (patch) | |
| tree | 53a5dd14398ff04282ff98f7e97f4560b3f84b58 /test | |
| parent | a05bafffdcb88df74408a8402cafc9829407c1e5 (diff) | |
| download | emacs-a6b598518c4bf6dfc587cfb2b61fa5fb04b99494.tar.gz 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')
| -rw-r--r-- | test/lisp/emacs-lisp/rx-tests.el | 4 |
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 @@ | |||
| 128 | (should (equal (rx (any) (not (any))) | 128 | (should (equal (rx (any) (not (any))) |
| 129 | "\\`a\\`[^z-a]")) | 129 | "\\`a\\`[^z-a]")) |
| 130 | (should (equal (rx (any "") (not (any ""))) | 130 | (should (equal (rx (any "") (not (any ""))) |
| 131 | "\\`a\\`[^z-a]"))) | 131 | "\\`a\\`[^z-a]")) |
| 132 | (should (equal (rx (any space ?a digit space)) | ||
| 133 | "[a[:space:][:digit:]]"))) | ||
| 132 | 134 | ||
| 133 | (ert-deftest rx-pcase () | 135 | (ert-deftest rx-pcase () |
| 134 | (should (equal (pcase "a 1 2 3 1 1 b" | 136 | (should (equal (pcase "a 1 2 3 1 1 b" |