summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust test to adjusted codeLars Ingebrigtsen2022-02-031-2/+2
|
* ; cperl-mode.el: Detect prototypes in anonymous subroutinesHarald Jörg2022-02-022-0/+99
| | | | | | | | | | | | | My commit 3d49ad73e5a from 2021-09-143 had a flaw causing bad fontification and indentation after anonymous subroutines with a prototype. * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Correctly process prototypes in anonymous subroutines * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-fontify-attrs-and-signatures): new tests for various combinations of attributes, prototypes, and signatures * test/lisp/progmodes/cperl-mode-resources/proto-and-attrs.pl: new test source
* Make more ranges sort properly in describe-keymapLars Ingebrigtsen2022-01-311-2/+2
| | | | | * lisp/subr.el (keymap-canonicalize): Don't consider two-character ranges as a range (bug#11325).
* (function-history): New symbol property (bug#53632)Stefan Monnier2022-01-313-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the code we have in Fdefalias that tries to keep track of definitions so as to be able to undo them later. We used to store in `load-history` when an autoload is redefined as a non-autoload and in the `autoload` symbol property we used to store the autoload data that used to be used before it got overriden. Instead, store the history of the function definition of a symbol in its `function-history` symbol property. To make this list cheap in the default case, the latest value is not stored in the list (since it's in the `symbol-function`) and neither is the first file. So if there's only been a single definition (the most common case), the list is empty and the property is just not present at all. The patch also gets rid of the `autoload` vs `defun` distinction in `load-history` which seems unnecessary (a significant part of the motivation for this patch was to get rid of the special handling of autoloads in this part of the code). * src/data.c (add_to_function_history): New function. (defalias): Use it. Don't add the `t` entries for autoloads and always use `defun` regardless of the kind of definition. Change `Vautoload_queue` to only hold the function symbols since the rest is now available from `function-history`. * src/eval.c (un_autoload): Adjust accordingly. * src/lread.c (load-history): Udate docstring. * lisp/loadhist.el (loadhist-unload-filename): New var. (unload-feature): Bind it. (loadhist-unload-element): Document its availability. (loadhist--restore-autoload): Delete var. (loadhist--unload-function): Delete function. (loadhist-unload-element): Delete the `t` and `autoload` methods. Rewrite the `defun` method using `function-history`. * lisp/help-fns.el: Require `seq`. (help-fns--autoloaded-p): Rewrite. (help-fns-function-description-header): Adjust call accordingly. * doc/lispref/loading.texi (Where Defined): Remove `autoload` and `t` entries from `load-history` since we don't generate them any more. Document the `function-history` which replaces the `autoload` property. (Unloading): Adjust symbol property name accordingly. * test/lisp/loadhist-resources/loadhist--bar.el: * test/lisp/loadhist-resources/loadhist--foo.el: New files. * test/lisp/loadhist-tests.el (loadhist-tests-unload-feature-nested) (loadhist-tests-unload-feature-notnested): New tests.
* Factor out function to check for clang in testsStefan Kangas2022-01-312-15/+5
| | | | | | | | | | | | | | | This also stops a flymake test from failing on my machine. * lisp/emacs-lisp/ert-x.el (ert-gcc-is-clang-p): New function factored out from ... * test/lisp/progmodes/flymake-tests.el (flymake-tests--gcc-is-clang): * test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test-output-parser-this-machine): ... here. * test/lisp/progmodes/flymake-tests.el (different-diagnostic-types) (included-c-header-files): * test/lisp/cedet/semantic/bovine/gcc-tests.el (semantic-gcc-test-output-parser-this-machine): Use above new function.
* Reduce code duplication in parts of (auto)load&defaliasStefan Monnier2022-01-281-1/+1
| | | | | | | | | | | | | | | | | | * src/data.c (defalias): New function, extracted from `Fdefalias`. (Fdefalias): Use it. (Ffset): Don't handle `Vautoload_queue` here, handle it in `defalias` instead. * src/comp.c (comp--register-subr): Use `defalias` instead of duplicating its code. * src/eval.c (load_with_autoload_queue): New function, extracted from `Fautoload_do_load`. (Fautoload_do_load): Use it. (un_autoload): Mark it as static. * src/fns.c (Frequire): Use it as well. * src/lisp.h (defalias, load_with_autoload_queue): New declarations. (un_autoload): Remove declaration.
* Fix copyright-fix-years, use a dash to separate years in a rangeLele Gaifax2022-01-281-0/+20
| | | | | | | | | | | | | | | | | Commit 7a46fa9c751f7c3147cd9b27fe84c1ce25419d3b, allowing en-dash as years separator, changed the way the years range is composed taking the separator from the `sep' variable instead of always using an hardwired hyphen. Since the code explicitly avoid to touch (that is, extend) existing ranges, that `sep' variable is almost always a space, or whatever character precedes the last parsed year, thus generating a range like "2020 2022" instead of "2020-2022". * lisp/emacs-lisp/copyright.el (copyright-fix-years): Always use an dash to separate years in a range. * test/lisp/emacs-lisp/copyright-tests.el (with-copyright-fix-years-test): (copyright-fix-years-tests--data): (text-copyright-fix-years): New test cases (bug#53597).
* Merge from origin/emacs-28Stefan Kangas2022-01-271-0/+23
|\ | | | | | | | | | | | | | | c9524819ea Partially revert a fill-region-as-paragraph regression 6075ea0b79 Fix 'make_lispy_position' when there's an image at EOB # Conflicts: # test/lisp/textmodes/fill-tests.el
| * Partially revert a fill-region-as-paragraph regressionLars Ingebrigtsen2022-01-261-0/+23
| | | | | | | | | | | | * lisp/textmodes/fill.el (fill-region-as-paragraph): Revert e186af261 (bug#53537), because it leads to regressions. (But leave tests in place.)
| * Fix copyright-find-copyright when searching from the endLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179). Do not merge to master.
| * Fix copyright.el comment and add a testLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179). Do not merge to master.
| * Mark a few more map tests as unstable on Emacs 28 (Bug#46722).Philipp Stephani2022-01-151-0/+12
| | | | | | | | | | | | | | | | | | | | At least for me, these tests still occasionally fail. Do not merge to master. * test/lisp/emacs-lisp/map-tests.el (test-map-into-hash-test) (test-map-merge, test-map-merge-with, test-map-merge-empty): Mark as unstable.
| * Mark test-map-into as unstableLars Ingebrigtsen2022-01-141-0/+3
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/map-tests.el (test-map-into): Mark as unstable (bug#46722). Do not merge to master.
* | Fix copyright-find-copyright when searching from the endLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Make the double check also work when searching from the end (bug#7179).
* | Fix copyright.el comment and add a testLars Ingebrigtsen2022-01-261-0/+11
| | | | | | | | | | * lisp/emacs-lisp/copyright.el (copyright-find-copyright): Fix comment (bug#7179).
* | Fix input of sharp-quoted symbols in Eshell with em-extpipeSean Whitton2022-01-261-0/+4
| | | | | | | | | | | | | | | | * lisp/eshell/em-extpipe.el (eshell-parse-external-pipeline): Fix misinterpreting sharp-quoted symbols as the beginning of single-quoted strings (Bug#53518). Add protection against a possible infinite loop. * test/lisp/eshell/em-extpipe-tests.el (em-extpipe-test-17): New test (bug#53518).
* | Adapt tramp-testsMichael Albinus2022-01-261-1/+1
| | | | | | | | | | * test/lisp/net/tramp-tests.el (tramp--test-special-characters): Adapt test candidates.
* | ; * test/lisp/emacs-lisp/derived-tests.el: Silence byte-compiler.Stefan Kangas2022-01-261-0/+3
| |
* | Tag an mml-sec testGlenn Morris2022-01-251-0/+3
| | | | | | | | | | * test/lisp/gnus/mml-sec-tests.el (mml-secure-en-decrypt-3): Tag unstable on hydra.nixos.org due to repeated intermittent failures.
* | Treat "-" as a positional arg in 'eshell-eval-using-options'Jim Porter2022-01-251-0/+21
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/esh-opt.el (eshell--process-args): Treat "-" as a positional arg. * lisp/eshell/em-tramp.el (eshell/su): Simplify checking for "-". * test/lisp/eshell/esh-opt-tests.el (esh-opt-test/eval-using-options-stdin): New test.
* | Don't manipulate args in-place for 'eshell-eval-using-options'Jim Porter2022-01-252-31/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary for preserve the original arguments to forward on to :external commands. Previously, when :preserve-args was also set, the original argument list could be altered, changing the meaning of the command. * lisp/eshell/esh-opt.el (eshell-eval-using-options): Copy MACRO-ARGS when :preserve-args is set, and pass the original value to 'eshell--do-opts'. (eshell--do-opts): Use the original arguments when calling an external command. * lisp/eshell/em-tramp.el (eshell/su, eshell/sudo): Don't copy the original arguments, since 'eshell-eval-using-options' does this for us. * test/lisp/eshell/esh-opt-tests.el (esh-opt-process-args-test): Split this test into... (esh-opt-test/process-args) (esh-opt-test/process-args-parse-leading-options-only) (esh-opt-test/process-args-external): ... these. (test-eshell-eval-using-options): Split this test into... (esh-opt-test/eval-using-options-short) (esh-opt-test/eval-using-options-long) (esh-opt-test/eval-using-options-constant) (esh-opt-test/eval-using-options-user-specified) (esh-opt-test/eval-using-options-short-single-token) (esh-opt-test/eval-using-options-terminate-options) (esh-opt-test/eval-using-options-parse-leading-options-only) (esh-opt-test/eval-using-options-unrecognized): ... these. (esh-opt-test/eval-using-options-external): New test. * test/lisp/eshell/em-tramp-tests.el: New tests.
* | Add Eshell syntax to more easily bypass Eshell's own pipeliningSean Whitton2022-01-242-2/+207
| | | | | | | | | | | | | | | | * etc/NEWS: * doc/misc/eshell.texi (Input/Output): Document the new syntax. * lisp/eshell/em-extpipe.el: New module (Bug#46351). * test/lisp/eshell/em-extpipe-tests.el: New tests. * lisp/eshell/esh-module.el (eshell-modules-list): Add `eshell-extpipe'.
* | Rework eshell-match-result for testing asynchronous commandsSean Whitton2022-01-242-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When using eshell-match-result via eshell-command-result-p to examine the output of asynchronous Eshell commands, a newly emitted prompt is included in the text against which the regexp is matched. This makes it awkward to match against the whole output; for example, to check whether it is empty. Rework the function to exclude the prompt. * test/lisp/eshell/eshell-tests-helpers.el (eshell-match-result): Exclude any newly emitted prompt from the text against which the regexp is matched. Additionally, the function no longer moves point. * test/lisp/eshell/eshell-tests.el (eshell-test/flush-output): Update and simplify test given how eshell-match-result no longer moves point.
* | Move Eshell test helpers to their own fileSean Whitton2022-01-242-53/+98
| | | | | | | | | | * test/lisp/eshell/eshell-tests.el: * test/lisp/eshell/eshell-tests-helpers.el: Move helpers to own file.
* | Add derived-mode test for bug#24176Lars Ingebrigtsen2022-01-241-0/+18
| |
* | Add new function 'readablep'Lars Ingebrigtsen2022-01-221-0/+4
| | | | | | | | | | * doc/lispref/streams.texi (Input Functions): Document it. * lisp/subr.el (readablep): New function (bug#52566).
* | Improve detection of suspicious uses of bidi controlsEli Zaretskii2022-01-221-4/+2
| | | | | | | | | | | | | | | | | | | | * lisp/international/textsec.el (textsec-bidi-controls-suspicious-p): New function. (textsec-name-suspicious-p): Use it. * test/lisp/international/textsec-tests.el (test-suspicious-name): Enable the test that was previously failing with 'bidi-find-overridden-directionality'.
* | Raise an error from 'eval-eval-using-options' for unknown optionsJim Porter2022-01-211-22/+64
| | | | | | | | | | | | | | | | | | | | * lisp/eshell/em-basic.el (eshell/echo): Add -E option. * lisp/eshell/esh-opt.el (eshell--process-option): Raise an error if an unknown option is encountered, even when :external is nil. * test/lisp/eshell/esh-opt-tests.el (esh-opt-process-args-test) (test-eshell-eval-using-options): Add test cases for this.
* | Further improve determination of when commands can be invoked directlyJim Porter2022-01-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This covers the case when a subcommand is to be invoked in more places than before, for example when a subcommand is concatenated in an argument. * lisp/eshell/esh-cmd.el (eshell--find-subcommands): New fuction. (eshell--invoke-command-directly): Use 'eshell-find-subcommands'. * test/lisp/eshell/eshell-tests.el (eshell-test/interp-cmd-external-concat): New test (bug#30725).
* | ruby-toggle-block-space-before-parameters: New user optionDmitry Gutov2022-01-211-0/+7
| | | | | | | | | | | | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-toggle-block-space-before-parameters): New user option (bug#53321). (ruby-do-end-to-brace): Handle it. * test/lisp/progmodes/ruby-mode-tests.el (ruby-toggle-block-to-brace-no-space): New test.
* | Make textsec-link-suspicious-p less mistrustfulLars Ingebrigtsen2022-01-201-7/+1
| | | | | | | | | | | | * lisp/international/textsec.el (textsec-link-suspicious-p): Scale back the suspicion -- only warn about texts that contain a full explicit link.
* | Fix thinko in previous hi-lock-read-face-name changeLars Ingebrigtsen2022-01-201-8/+6
| | | | | | | | | | * lisp/hi-lock.el (hi-lock-read-face-name): Fix the string/symbol logic.
* | Consider subcommands when deciding to invoke Eshell command directlyJim Porter2022-01-201-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an Eshell command contains an asynchronous subcommand (such as calling an external process), it must be evaluated iteratively. See bug#30725. * lisp/eshell/esh-cmd.el (eshell-invoke-command): Move most of the logic from here... (eshell--invoke-command-directly): ... to here. Also add checks for subcommands. * test/lisp/eshell/eshell-tests.el (eshell-test--max-subprocess-time): New variable. (eshell-wait-for-subprocess): New function. (eshell-command-result-p): Use 'eshell-wait-for-subprocess'. (eshell-test/interp-cmd-external): New test (bug#30725).
* | Re-enable some textsec-tests after recent bidi.c fixLars Ingebrigtsen2022-01-201-7/+7
| |
* | Add test for bug#51733Lars Ingebrigtsen2022-01-201-1/+4
| |
* | Allow suspicious names with some forms of bidi controlsLars Ingebrigtsen2022-01-201-4/+9
| | | | | | | | | | * lisp/international/textsec.el (textsec-name-suspicious-p): Allow names with bidi-find-overridden-directionality.
* | Check link text domain suspiciousnessLars Ingebrigtsen2022-01-201-1/+3
| | | | | | | | | | * lisp/international/textsec.el (textsec-link-suspicious-p): Check whether the domain in the link text is suspicious.
* | Expand textsec-link-suspicious-p checkingLars Ingebrigtsen2022-01-201-1/+7
| | | | | | | | | | * lisp/international/textsec.el (textsec-link-suspicious-p): Check the text more thoroughly for link-like things.
* | Improve textsec-domain-suspicious-p messageLars Ingebrigtsen2022-01-201-0/+4
| | | | | | | | | | | | * lisp/international/textsec.el (textsec-domain-suspicious-p): Ensure that we're not confusing the user if there's a directional override in the string we're checking.
* | Make textsec-mixed-numbers-p actually workLars Ingebrigtsen2022-01-191-0/+1
| | | | | | | | | | * lisp/international/textsec.el (textsec-mixed-numbers-p): Fix the test.
* | Add text for suspicious linksLars Ingebrigtsen2022-01-191-0/+18
| | | | | | | | | | | | | | | | | | | | * lisp/international/textsec-check.el (textsec-check): Note `link'. (textsec-propertize): Fix typo. * lisp/international/textsec.el (textsec-link-suspicious-p): New function. * lisp/net/shr.el (shr-tag-a): Check for sus links.
* | Make shr mark links with suspicious URLsLars Ingebrigtsen2022-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | * lisp/international/textsec-check.el (textsec-propertize): New function. (textsec-check): Only check, don't alter STRING. * lisp/international/textsec.el (textsec-url-suspicious-p): New function. * lisp/net/shr.el (shr-tag-a): Mark suspicious links.
* | Add new file textsec-check.elLars Ingebrigtsen2022-01-191-5/+10
| | | | | | | | | | | | * lisp/international/textsec-check.el: New file. * lisp/international/textsec.el (textsec-email-address-header-suspicious-p): Rename.
* | Mark whole-script confusables as suspicious domainsLars Ingebrigtsen2022-01-191-1/+4
| | | | | | | | | | | | | | * lisp/international/textsec.el (textsec-domain-suspicious-p): Consider domain names that are whole-script confusables with ASCII to be suspicious. (I think this is what the Unicode standard is recommending, but I'm not 100% sure.)
* | Split textsec-email-address-suspicious-p into two functionsLars Ingebrigtsen2022-01-191-1/+3
| | | | | | | | | | | | * lisp/international/textsec.el (textsec-email-address-suspicious-p): Made into its own function. (textsec-email-suspicious-p): Use it and adjust doc strings.
* | Make textsec-suspicious-nonspacing-p work on marksLars Ingebrigtsen2022-01-191-3/+3
| | | | | | | | | | | | * lisp/international/textsec.el (textsec-suspicious-nonspacing-p): We're only interested in nonspacing marks, not control characters in this test.
* | cl-generic-tests.el: Fix warningStefan Monnier2022-01-181-1/+1
| | | | | | | | | | * test/lisp/emacs-lisp/cl-generic-tests.el (ert): Require at run-time for `ert--get-explainer`.
* | VC: Fix tests for SCCS and MtnStefan Monnier2022-01-181-10/+21
| | | | | | | | | | | | | | * test/lisp/vc/vc-tests.el: Prefer closures to `(lambda ...). (vc-test-mtn05-rename-file, vc-test-mtn06-version-diff): Skip. * lisp/vc/vc.el (vc-responsible-backend): Fix vc-test--register on SCCS.
* | Add textsec functions for verifying email addressesLars Ingebrigtsen2022-01-181-0/+39
| | | | | | | | | | | | | | | | | | | | | | * lisp/international/characters.el (bidi-control-characters): Rename from glyphless--bidi-control-characters for use in textsec, and add LRM/RLM/ALM. (update-glyphless-char-display): Adjust the code. * lisp/international/textsec.el (textsec-local-address-suspicious-p) (textsec-name-suspicious-p, textsec-suspicious-nonspacing-p) (textsec-email-suspicious-p): New functions.
* | Add textsec-domain-suspicious-pLars Ingebrigtsen2022-01-183-0/+6355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore: Ignore idna-mapping.el. * admin/notes/unicode: Note idna-mapping file. * admin/unidata/IdnaMappingTable.txt: New file. * admin/unidata/Makefile.in (all): Generate idna-mapping.el. * admin/unidata/unidata-gen.el (unidata-gen-idna-mapping): Generate. * lisp/international/textsec.el (textsec-domain-suspicious-p): New function.