summaryrefslogtreecommitdiff
path: root/test/src/regex-emacs-tests.el
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* (regexp-tests-backtrack-optimization): Mark it as failingStefan Monnier2023-09-051-0/+1
| | | | | * test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization): The fix for bug#65726 broke some of the optimization added for bug#61514.
* ; Add regression test for bug#65726Mattias Engdegård2023-09-051-0/+4
| | | | | * test/src/regex-emacs-tests.el (regex-tests-mutual-exclusive-inf-rec): New test.
* regex-emacs.c: Reduce the use of backtracking a bit furtherStefan Monnier2023-02-201-0/+11
| | | | | | | | | | | bug#61514 exhibited some undesirable backtracking in a case where it's easy to avoid it by making `mutually_exclusive_p` just a bit more careful. * src/regex-emacs.c (mutually_exclusive_p): Handle `on_failure_jump`s. * test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization): Add a few tests.
* ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
|
* Fix regexp matching with atomic strings and optimised backtrackingMattias Engdegård2022-10-241-0/+5
| | | | | | | | | | | | | | | | This bug occurs when an atomic pattern is matched at the end of a string and the on-failure-keep-string-jump optimisation is in effect, as in: (string-match "\\'\\(?:ab\\)*\\'" "a") which succeeded but clearly should not (bug#58726). Reported by Michael Heerdegen. * src/regex-emacs.c (PREFETCH): Add reset parameter. (re_match_2_internal): Use it for proper atomic pattern treatment. * test/src/regex-emacs-tests.el (regexp-atomic-failure): New test.
* Audit quoting the quote character in doc stringsLars Ingebrigtsen2022-04-221-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/regex-emacs-tests.el (regex-tests-compare): (regex-tests-compare): (regex-tests-match): * test/lisp/xml-tests.el (xml-parse-tests--qnames): * test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from): * test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset): * test/lisp/calc/calc-tests.el (calc-tests-equal): * lisp/window.el (get-lru-window): (get-mru-window): (get-largest-window): (quit-restore-window): (display-buffer): * lisp/vc/vc-rcs.el (vc-rcs-consult-headers): * lisp/url/url-auth.el (url-digest-auth-build-response): * lisp/tutorial.el (tutorial--find-changed-keys): * lisp/transient.el (transient-suffix-object): * lisp/textmodes/rst.el (rst-insert-list-new-item): * lisp/textmodes/bibtex.el (bibtex-clean-entry): * lisp/tab-bar.el (tab-bar--key-to-number): (toggle-frame-tab-bar): * lisp/ses.el (ses-recalculate-cell): (ses-define-local-printer): (ses-prin1): * lisp/progmodes/xref.el (xref--find-ignores-arguments): * lisp/progmodes/verilog-mode.el (verilog-single-declaration-end): * lisp/progmodes/tcl.el (tcl-mode-hook): * lisp/progmodes/gdb-mi.el (gdb-get-buffer-create): * lisp/progmodes/elisp-mode.el (elisp--xref-make-xref): * lisp/play/dunnet.el (dun-room-objects): * lisp/outline.el (outline--cycle-state): * lisp/org/ox-publish.el (org-publish-find-property): * lisp/org/ox-html.el (org-html--unlabel-latex-environment): * lisp/org/org-table.el (org-table-collapse-header): * lisp/org/org-plot.el (org--plot/prime-factors): * lisp/org/org-agenda.el (org-agenda--mark-blocked-entry): (org-agenda-set-restriction-lock): * lisp/org/ob-lua.el (org-babel-lua-read-string): * lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process): (org-babel-julia-evaluate-session): * lisp/org/ob-core.el (org-babel-default-header-args): * lisp/obsolete/mouse-sel.el (mouse-select): (mouse-select-secondary): * lisp/net/tramp.el (tramp-methods): * lisp/net/eww.el (eww-accept-content-types): * lisp/net/dictionary-connection.el (dictionary-connection-status): * lisp/minibuffer.el (completion-flex--make-flex-pattern): * lisp/mh-e/mh-mime.el (mh-have-file-command): * lisp/mh-e/mh-limit.el (mh-subject-to-sequence): (mh-subject-to-sequence-threaded): (mh-subject-to-sequence-unthreaded): * lisp/mail/feedmail.el (feedmail-queue-buffer-file-name): (feedmail-vm-mail-mode): * lisp/ls-lisp.el (ls-lisp--sanitize-switches): * lisp/keymap.el (key-valid-p): * lisp/international/ccl.el (ccl-compile-branch-blocks): * lisp/image/image-converter.el (image-convert): * lisp/gnus/spam.el (spam-backend-check): * lisp/gnus/nnselect.el (nnselect-generate-artlist): * lisp/gnus/nnmairix.el (nnmairix-widget-other): * lisp/gnus/message.el (message-mailto): * lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article): * lisp/gnus/gnus-search.el (gnus-search-prepare-query): * lisp/frame.el (frame-size-history): * lisp/eshell/esh-var.el (eshell-parse-variable-ref): * lisp/eshell/em-dirs.el (eshell-expand-multiple-dots): * lisp/erc/erc-backend.el (erc-bounds-of-word-at-point): * lisp/emulation/cua-rect.el (cua--rectangle-operation): * lisp/emacs-lisp/text-property-search.el (text-property-search-forward): * lisp/emacs-lisp/package.el (package-desc-suffix): * lisp/emacs-lisp/faceup.el (faceup-test-explain): * lisp/emacs-lisp/comp.el (comp-curr-allocation-class): (comp-alloc-class-to-container): (comp-add-cstrs): (comp-remove-type-hints-func): (batch-byte+native-compile): * lisp/emacs-lisp/cl-macs.el (cl--optimize): * lisp/elec-pair.el (electric-pair--syntax-ppss): * lisp/doc-view.el (doc-view-doc-type): * lisp/cedet/semantic/symref.el (semantic-symref-tool-alist): (semantic-symref-hit-to-tag-via-db): (semantic-symref-hit-to-tag-via-buffer): * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay): * lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map): * lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function): * lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions): * lisp/cedet/semantic.el (semantic-working-type): * lisp/cedet/ede/files.el (ede-flush-directory-hash): * lisp/calc/calc.el (calc--header-line): * lisp/auth-source.el (auth-source-pick-first-password): (auth-source--decode-octal-string): * etc/themes/modus-themes.el (modus-themes--paren): (modus-themes--agenda-habit): * admin/cus-test.el (cus-test-vars-with-changed-state): Fix quoting in doc strings. In code examples, the ' character is quoted with \\=, and regularize 'foo to `foo', and quote strings like "foo" instead of 'foo'.
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-011-1/+1
|
* ; Minor stylistic checkdoc fixes in test/**/*.elStefan Kangas2021-09-261-14/+14
|
* Update copyright year to 2021Paul Eggert2021-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Recognise ß properly as a lower-case letter (bug#11309)Mattias Engdegård2020-12-091-4/+11
| | | | | | | | | | | | | | ß was incorrectly treated as a caseless character and thus not matched by the regexp [[:lower:]] (or, in case-folding mode, [[:upper:]]). The reason is that the upcase table maps it to itself, which can be remedied by mapping it to ẞ (U+7838) instead. Doing so does not affect upcasing since the special-uppercase property maps it to SS. * lisp/international/characters.el (tbl): Map ß to ẞ in the upcase table. * test/src/regex-emacs-tests.el (regexp-eszett): Uncomment previously failing tests. Add checks to make sure that case transformations remain valid.
* Fix [:upper:] and [:lower:] for Unicode characters (bug#11309)Mattias Engdegård2020-12-091-0/+57
| | | | | | | | * src/regex-emacs.c (execute_charset): Add canon_table argument to allow expression of a correct predicate for [:upper:] and [:lower:]. (mutually_exclusive_p, re_match_2_internal): Pass extra argument. * test/src/regex-emacs-tests.el (regexp-case-fold, regexp-eszett): New tests. Parts of regexp-eszett still fail and are commented out.
* Revert "Signal an error for the regexp "[:alnum:]""Mattias Engdegård2020-02-271-5/+0
| | | | This reverts commit 8d5e8cddab732ac90e9ae930c63f7830f9dab24f.
* Revert "Don't complain about the regexp "[:-:]""Mattias Engdegård2020-02-271-2/+1
| | | | This reverts commit 3766bf728a43933083f4525970bcf9fdace3838d.
* Don't complain about the regexp "[:-:]"Mattias Engdegård2020-02-261-1/+2
| | | | | | | Suggested by Clément Pit-Claudel. * src/regex-emacs.c (regex_compile): * test/src/regex-emacs-tests.el (regexp-invalid): Tolerate ranges.
* Signal an error for the regexp "[:alnum:]"Mattias Engdegård2020-02-261-0/+5
| | | | | | | | | | 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.
* Remove subsumed repetitions in regexpsMattias Engdegård2020-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make regexps smaller and faster by removing terms that are superfluous by virtue of standing next to another term that matches more. See https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00949.html for details. * lisp/bs.el (bs--make-header-match-string): * lisp/gnus/deuglify.el (gnus-outlook-repair-attribution-block): * lisp/gnus/message.el (message-subject-trailing-was-ask-regexp) (message-subject-trailing-was-regexp): * lisp/informat.el (Info-validate): * lisp/net/browse-url.el (browse-url-button-regexp): * lisp/net/rcirc.el (rcirc-url-regexp): * lisp/org/ob-core.el (org-babel-remove-result): * lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap): * lisp/org/org-capture.el (org-capture-set-target-location): * lisp/org/org-table.el (org-table-expand-lhs-ranges): * lisp/org/org.el (org-maybe-keyword-time-regexp, org-ts-regexp) (org-ts-regexp-inactive, org-ts-regexp-both): * lisp/play/gametree.el (gametree-hack-file-layout): * lisp/progmodes/cc-mode.el (c-Java-defun-prompt-regexp): * lisp/progmodes/idlw-shell.el (idlwave-shell-halting-error): * lisp/progmodes/ruby-mode.el (ruby-mode-set-encoding): * lisp/progmodes/verilog-mode.el (verilog-error-font-lock-keywords) (verilog-verilint-off, verilog-case-indent-level) (verilog-within-translate-off, verilog-start-translate-off) (verilog-back-to-start-translate-off, verilog-end-translate-off) (verilog-expand-dirnames): * lisp/term.el (term-control-seq-regexp): * lisp/textmodes/reftex-vars.el (featurep): * lisp/url/url-gw.el (url-open-telnet): * lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp): * lisp/vc/pcvs-parse.el (cvs-parse-status): * test/src/regex-emacs-tests.el (regex-tests-PCRE): Remove subsumed repetitions. * lisp/progmodes/sh-script.el (sh-syntax-propertize-function): Simplify repetition of a repetition.
* Remove (or double) redundant backslashes in string literalsMattias Engdegård2020-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See discussion at https://lists.gnu.org/archive/html/emacs-devel/2020-01/msg00749.html . * lisp/obsolete/iswitchb.el (iswitchb-summaries-to-end): * test/src/regex-emacs-tests.el (regex-tests-BOOST-frob-escapes): * test/lisp/help-fns-tests.el (help-fns-test-lisp-macro) (help-fns-test-lisp-defun, help-fns-test-lisp-defsubst) (help-fns-test-alias-to-defun, help-fns-test-bug23887): Double backslashes for desired effect. * lisp/org/ol.el (org-link-escape): * lisp/net/nsm.el (nsm-protocol-check--rsa-kx) (nsm-protocol-check--anon-kx, nsm-protocol-check--sha1-sig): * lisp/obsolete/old-whitespace.el (whitespace-buffer): * lisp/obsolete/rcompile.el (remote-compile-run-before): * lisp/obsolete/vi.el (vi-end-of-blank-delimited-word): * lisp/obsolete/vip.el (vip-current-major-mode) (vip-paren-match, vip-switch-to-buffer) (vip-switch-to-buffer-other-window, vip-kill-buffer) (vip-get-ex-token, ex-edit): * lisp/org/org-element.el (org-element--cache-sync-requests): * lisp/org/org.el (org-sparse-tree): * lisp/textmodes/reftex.el (reftex-report-bug): * test/lisp/ibuffer-tests.el (ibuffer-save-filters): * test/lisp/international/ucs-normalize-tests.el (ucs-normalize-tests--insert-failing-lines): * test/lisp/simple-tests.el (undo-test-kill-c-a-then-undo): * test/lisp/textmodes/conf-mode-tests.el (conf-test-toml-mode): * test/src/regex-emacs-tests.el (regex-tests-compare): Remove redundant backslashes.
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* Correct regexp matching of raw bytesMattias Engdegård2019-06-281-0/+120
| | | | | | | | | | | | | | | | Make regexp matching of raw bytes work in all combination of unibyte and multibyte patterns and targets, as exact strings and in character alternatives (bug#3687). * src/regex-emacs.c (analyze_first): Include raw byte in fastmap when pattern is a multibyte exact string. Include leading byte in fastmap for raw bytes in character alternatives. (re_match_2_internal): Decrement the byte count by the number of bytes in the pattern character, not 1. * test/src/regex-emacs-tests.el (regexp-unibyte-unibyte) (regexp-multibyte-unibyte, regexp-unibyte-mutibyte) (regexp-multibyte-multibyte): New tests.
* More regexp corrections and tweaksPaul Eggert2019-03-101-1/+1
| | | | | | | | | | | | | | Problems reported by Mattias Engdegård in: https://lists.gnu.org/r/emacs-devel/2019-03/msg00247.html * lisp/align.el (align-rules-list): * lisp/comint.el (comint-output-filter): * lisp/language/china-util.el (encode-hz-region): * lisp/progmodes/cperl-mode.el (cperl-indent-exp): * lisp/progmodes/idlwave.el (idlwave-is-pointer-dereference): * lisp/progmodes/scheme.el (dsssl-font-lock-keywords): * lisp/textmodes/texinfmt.el (texinfo-accent-commands): * test/src/regex-emacs-tests.el (regex-tests-re-even-escapes): Fix some regular-expression typos.
* Document that [:cntrl:] does not match DEL (Bug#34391)Mattias Engdegård2019-02-101-3/+3
| | | | | | | | * doc/lispref/searching.texi (Character Classes): * lisp/emacs-lisp/rx.el (rx): Document that [:cntrl:] excludes DEL. * test/src/regex-emacs-tests.el (regex-tests-PTESTS-whitelist): Swap misplaced comments and fix wrong code for DEL.
* Merge from origin/emacs-26Paul Eggert2018-12-311-1/+1
| | | | | | 2fcf2df Fix copyright years by hand 26bed8b Update copyright year to 2019 2814292 Fix value of default frame height. (Bug#33921)
* Rename src/regex.c to src/regex-emacs.c.Paul Eggert2018-08-051-0/+686
This is in preparation for using Gnulib regex for etags, to avoid collisions in include directives. * src/regex-emacs.c: Rename from src/regex.c. * src/regex-emacs.h: Rename from src/regex.h. All uses changed. * test/src/regex-emacs-tests.el: Rename from test/src/regex-tests.el.