summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-02-29 10:12:10 +0100
committerMattias EngdegÄrd <mattiase@acm.org>2020-02-29 10:15:51 +0100
commitd42419590563964fd61b35dea7738e77c0f90cba (patch)
treeffda968b876185033881bd959f30ce7946eb17ee /test
parent9908b5a61438ab82964d43bcfbcbe968d9bf601b (diff)
downloademacs-d42419590563964fd61b35dea7738e77c0f90cba.tar.gz
Fix rx charset generation
* lisp/emacs-lisp/rx.el (rx--charset-p): Don't overquote. (rx--generate-alt): Generate '.' for negated newline. * test/lisp/emacs-lisp/rx-tests.el (rx-any, rx-charset-or): Test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index a6c172adfe7..2e34d65a9aa 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -130,7 +130,10 @@
(should (equal (rx (any "") (not (any "")))
"\\`a\\`[^z-a]"))
(should (equal (rx (any space ?a digit space))
- "[a[:space:][:digit:]]")))
+ "[a[:space:][:digit:]]"))
+ (should (equal (rx (not "\n") (not ?\n) (not (any "\n")) (not-char ?\n)
+ (| (not (in "a\n")) (not (char ?\n (?b . ?b)))))
+ ".....")))
(ert-deftest rx-pcase ()
(should (equal (pcase "a 1 2 3 1 1 b"
@@ -298,7 +301,11 @@
(not (any "a-k"))))
"[^abh-k]"))
(should (equal (rx (or ?f (any "b-e") "a") (not (or ?x "y" (any "s-w"))))
- "[a-f][^s-y]")))
+ "[a-f][^s-y]"))
+ (should (equal (rx (not (or (in "abc") (char "bcd"))))
+ "[^a-d]"))
+ (should (equal (rx (or (not (in "abc")) (not (char "bcd"))))
+ "[^bc]")))
(ert-deftest rx-def-in-charset-or ()
(rx-let ((a (any "badc"))