[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 63578dc: * test/lisp/emacs-lisp/rx-tests.el: Improve test coverag
From: |
Mattias Engdegård |
Subject: |
master 63578dc: * test/lisp/emacs-lisp/rx-tests.el: Improve test coverage. |
Date: |
Sat, 29 Aug 2020 07:12:17 -0400 (EDT) |
branch: master
commit 63578dc4355ebdf0e2b0a56280f71aa5f28ac6a0
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
* test/lisp/emacs-lisp/rx-tests.el: Improve test coverage.
---
test/lisp/emacs-lisp/rx-tests.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 0e6f278..3b01d89 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"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 63578dc: * test/lisp/emacs-lisp/rx-tests.el: Improve test coverage.,
Mattias Engdegård <=