diff options
| author | Stefan Monnier | 2023-09-28 12:37:44 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2023-09-28 12:37:44 -0400 |
| commit | 7c26501175f7dc657c677c151d49d04291ea67e7 (patch) | |
| tree | 1e0e7be5a4ffcba27924243f960de7cc8d79613b /test/src | |
| parent | 0c15c7d9467f33ccc317296af00440b37569c703 (diff) | |
| download | emacs-7c26501175f7dc657c677c151d49d04291ea67e7.tar.gz emacs-7c26501175f7dc657c677c151d49d04291ea67e7.zip | |
regex.c (mutually_exclusive_aux) <wordbound>: Remove optimization
Another case that was too optimistic. Better use \> or \< rather
than \b if you want your regexp to be handled efficiently.
* src/regex-emacs.c (mutually_exclusive_aux) <wordbound>: Cancel optimization.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
New test.
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/regex-emacs-tests.el | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/src/regex-emacs-tests.el b/test/src/regex-emacs-tests.el index d78f70ba409..621e4dbe2c0 100644 --- a/test/src/regex-emacs-tests.el +++ b/test/src/regex-emacs-tests.el | |||
| @@ -907,6 +907,7 @@ This evaluates the TESTS test cases from glibc." | |||
| 907 | ;; Regression check for overly optimistic optimization. | 907 | ;; Regression check for overly optimistic optimization. |
| 908 | (should (eq 0 (string-match "\\(ca*\\|ab\\)+d" "cabd"))) | 908 | (should (eq 0 (string-match "\\(ca*\\|ab\\)+d" "cabd"))) |
| 909 | (should (string-match "\\(aa*\\|b\\)*c" "ababc")) | 909 | (should (string-match "\\(aa*\\|b\\)*c" "ababc")) |
| 910 | (should (string-match " \\sw*\\bfoo" " foo")) | ||
| 910 | )) | 911 | )) |
| 911 | 912 | ||
| 912 | (ert-deftest regexp-tests-zero-width-assertion-repetition () | 913 | (ert-deftest regexp-tests-zero-width-assertion-repetition () |