From: Mattias EngdegÄrd Date: Sat, 29 Aug 2020 11:10:18 +0000 (+0200) Subject: * test/lisp/emacs-lisp/rx-tests.el: Improve test coverage. X-Git-Tag: emacs-28.0.90~6331 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=63578dc4355ebdf0e2b0a56280f71aa5f28ac6a0;p=emacs.git * test/lisp/emacs-lisp/rx-tests.el: Improve test coverage. --- diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 0e6f27836ea..3b01d89dbab 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el @@ -56,9 +56,12 @@ (ert-deftest rx-def-in-or () (rx-let ((a b) (b (or "abc" c)) - (c ?a)) + (c ?a) + (d (any "a-z"))) (should (equal (rx (or a (| "ab" "abcde") "abcd")) - "\\(?:a\\(?:b\\(?:c\\(?:de?\\)?\\)?\\)?\\)")))) + "\\(?:a\\(?:b\\(?:c\\(?:de?\\)?\\)?\\)?\\)")) + (should (equal (rx (or ?m (not d))) + "[^a-ln-z]")))) (ert-deftest rx-char-any () "Test character alternatives with `]' and `-' (Bug#25123)." @@ -132,8 +135,8 @@ ;; relint suppression: Single-character range .f-f ;; relint suppression: Range .--/. overlaps previous .- ;; relint suppression: Range .\*--. overlaps previous .--/ - (should (equal (rx (any "-a" "c-" "f-f" "--/*--")) - "[*-/acf]")) + (should (equal (rx (any "-a" "c-" "f-f" "--/*--") (any "," "-" "A")) + "[*-/acf][,A-]")) (should (equal (rx (any "]-a" ?-) (not (any "]-a" ?-))) "[]-a-][^]-a-]")) (should (equal (rx (any "--]") (not (any "--]")) @@ -394,6 +397,8 @@ "ab"))) (ert-deftest rx-literal () + (should (equal (rx (literal "$a")) + "\\$a")) (should (equal (rx (literal (char-to-string 42)) nonl) "\\*.")) (let ((x "a+b"))