1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-13 09:32:47 +00:00

Fix regexp mistakes

* lisp/progmodes/cperl-mode.el (cperl--package-regexp):
Avoid double repetition; cperl--ws-or-comment-regexp is already
repeated with 1+.
* test/lisp/textmodes/dns-mode-tests.el
(dns-mode-tests-dns-mode-soa-increment-serial): Escape literal '$'.
* test/lisp/emacs-lisp/rx-tests.el (rx-regexp): Modify test to not
trigger a linting warning while retaining its testing power.
This commit is contained in:
Mattias Engdegård 2021-02-19 13:44:25 +01:00
parent ea2f5f3fda
commit d4f6927d48
3 changed files with 4 additions and 4 deletions

View File

@ -1305,7 +1305,7 @@ is a legal variable name).")
(group (regexp ,cperl--normal-identifier-regexp))
(opt
(sequence
(1+ (regexp ,cperl--ws-or-comment-regexp))
(regexp ,cperl--ws-or-comment-regexp)
(group (regexp ,cperl--version-regexp))))))
"A regular expression for package NAME VERSION in Perl.
Contains two groups for the package name and version.")

View File

@ -388,11 +388,11 @@
(ert-deftest rx-regexp ()
(should (equal (rx (regexp "abc") (regex "[de]"))
"\\(?:abc\\)[de]"))
(should (equal (rx "a" (regexp "$"))
"a\\(?:$\\)"))
(let ((x "a*"))
(should (equal (rx (regexp x) "b")
"\\(?:a*\\)b"))
(should (equal (rx "a" (regexp "*"))
"a\\(?:*\\)"))
(should (equal (rx "" (regexp x) (eval ""))
"a*"))))

View File

@ -37,7 +37,7 @@
(dns-mode-soa-increment-serial)
;; Number is updated from 2015080302 to the current date
;; (actually, just ensure the year part is later than 2020).
(should (string-match "$TTL 86400
(should (string-match "\\$TTL 86400
@ IN SOA ns.icann.org. noc.dns.icann.org. (
20[2-9][0-9]+ ;Serial
7200 ;Refresh