diff options
| author | Mattias Engdegård <mattiase@acm.org> | 2020-02-26 14:46:01 +0100 |
|---|---|---|
| committer | Mattias Engdegård <mattiase@acm.org> | 2020-02-26 22:09:17 +0100 |
| commit | 8d5e8cddab732ac90e9ae930c63f7830f9dab24f (patch) | |
| tree | 6db0e10a351f5d1292a67f4c02c3eefeb00b9714 /test/src/regex-emacs-tests.el | |
| parent | 2261f89324997351a41d8f12af513b8ec5e9c26b (diff) | |
| download | emacs-8d5e8cddab732ac90e9ae930c63f7830f9dab24f.tar.gz | |
Signal an error for the regexp "[:alnum:]"
Omitting the extra brackets is a common mistake; see discussion at
https://lists.gnu.org/archive/html/emacs-devel/2020-02/msg00215.html
* src/regex-emacs.c (reg_errcode_t, re_error_msgid): Add REG_ECLASSBR.
(regex_compile): Check for the mistake.
* test/src/regex-emacs-tests.el (regexp-invalid): Test.
* etc/NEWS: Announce.
Diffstat (limited to 'test/src/regex-emacs-tests.el')
| -rw-r--r-- | test/src/regex-emacs-tests.el | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index f9372e37b11..661d416e6a7 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el @@ -803,4 +803,9 @@ This evaluates the TESTS test cases from glibc." (should-not (string-match "å" "\xe5")) (should-not (string-match "[å]" "\xe5"))) +(ert-deftest regexp-invalid () + ;; relint suppression: Duplicated + (should-error (string-match "[:space:]" "") + :type 'invalid-regexp)) + ;;; regex-emacs-tests.el ends here |
