diff options
| author | Mattias Engdegård | 2020-02-26 14:46:01 +0100 |
|---|---|---|
| committer | Mattias Engdegård | 2020-02-26 22:09:17 +0100 |
| commit | 8d5e8cddab732ac90e9ae930c63f7830f9dab24f (patch) | |
| tree | 6db0e10a351f5d1292a67f4c02c3eefeb00b9714 /test/src | |
| parent | 2261f89324997351a41d8f12af513b8ec5e9c26b (diff) | |
| download | emacs-8d5e8cddab732ac90e9ae930c63f7830f9dab24f.tar.gz emacs-8d5e8cddab732ac90e9ae930c63f7830f9dab24f.zip | |
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')
| -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." | |||
| 803 | (should-not (string-match "å" "\xe5")) | 803 | (should-not (string-match "å" "\xe5")) |
| 804 | (should-not (string-match "[å]" "\xe5"))) | 804 | (should-not (string-match "[å]" "\xe5"))) |
| 805 | 805 | ||
| 806 | (ert-deftest regexp-invalid () | ||
| 807 | ;; relint suppression: Duplicated | ||
| 808 | (should-error (string-match "[:space:]" "") | ||
| 809 | :type 'invalid-regexp)) | ||
| 810 | |||
| 806 | ;;; regex-emacs-tests.el ends here | 811 | ;;; regex-emacs-tests.el ends here |