summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix the latest dabbrev-expand test fixStephen Berman2024-12-031-2/+7
| | | | | | | | * test/lisp/dabbrev-tests.el (dabbrev-expand-after-killing-buffer): In batch runs of this file, the user-error message contains curved quotes, but grave quotes when running `make check' (so here was evidently not passed to `substitute-command-keys'), so use grave quotes so the test succeeds in both modes of execution.
* Fix latest test for dabbrev-expandStephen Berman2024-12-021-14/+6
| | | | | | * test/lisp/dabbrev-tests.el (dabbrev-expand-after-killing-buffer): Fix typo in a 'should' test, use part of return value of 'should-error' test, and remove mistaken and unfounded FIXME comment.
* Prevent "Selecting deleted buffer" error with dabbrev-expandStephen Berman2024-11-301-1/+33
| | | | | | | | | * lisp/dabbrev.el (dabbrev-expand): Use the buffer where the last expansion was found only if it is still a live buffer (bug#74090). * test/lisp/dabbrev-tests.el (dabbrev-expand-test-minibuffer-3): Fix typo in doc string. (dabbrev-expand-after-killing-buffer): New test.
* Skip proced refine tests on DarwinLaurence Warne2024-11-221-0/+3
| | | | | * test/lisp/proced-tests.el (proced-refine-test) (proced-refine-with-update-test): Skip if the system is Darwin.
* Don't error in Proced tests if %CPU is a NaNLaurence Warne2024-11-151-6/+18
| | | | | | | | | | | | * test/lisp/proced-tests.el (proced--cpu-at-point): New function. (proced--assert-process-valid-cpu-refinement) (proced-refine-test, proced-refine-with-update-test): If %CPU for any process visited is a NaN skip the test. (proced-update-preserves-pid-at-point-test): Fix typo in comment. (proced--assert-process-valid-cpu-refinement-explainer): Add process attributes to the explainer along with tweaking how the process %CPU is obtained to account for circumstances where it's not numeric (most notably '-nan').
* Improve comment indenting in 'lua-ts-mode'john muhl2024-11-141-0/+42
| | | | | | | | | | * lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules): Align single line comments with the surrounding context. (lua-ts--comment-first-sibling-matcher): Check that comment is the first sibling. (lua-ts--multi-line-comment-start): New function. * test/lisp/progmodes/lua-ts-mode-resources/indent.erts: Add tests. (Bug#74298)
* Fix wrong value of `when` and `unless` with empty body (bug#74215)Mattias Engdegård2024-11-061-1/+5
| | | | | | | | * lisp/subr.el (when, unless): Return nil when the body is empty. Reported by Brennan Vincent. * test/lisp/subr-tests.el (subr-test-when): Add test cases. (cherry picked from commit 9ee9154247454c18f9f75d0d32592b817d7e977a)
* ; Instrument proced-tests.el furtherMichael Albinus2024-11-041-1/+5
| | | | | * test/lisp/proced-tests.el (proced--assert-process-valid-cpu-refinement): Explain also Lisp errors.
* project-tests: Add test assertion for bug#73801Dmitry Gutov2024-11-011-1/+5
| | | | | | | | * test/lisp/progmodes/project-tests.el (project-vc-extra-root-markers-supports-wildcards): End with a check that we didn't cache a wrong value for parent (bug#73801). (cherry picked from commit 94a9e40e82d4180563d7bddfa0cc6c8990824f8d)
* Fix bugs in dabbrev-expand (bug#74090)Stephen Berman2024-10-313-0/+492
| | | | | | | | | | | | | | | | | | | * lisp/dabbrev.el (dabbrev-expand): Use the buffer where the expansion was found when setting the internal variables used to determine the next expansion or a replacement expansion. * test/lisp/dabbrev-tests.el (ert-x): Require for 'ert-with-temp-directory', 'ert-resource-directory' and 'ert-resource-file'. (with-dabbrev-test): New macro. (dabbrev-expand-test-same-buffer-{1,2,3,4}) (dabbrev-expand-test-other-buffer-{1,2,3,4}) (dabbrev-expand-test-minibuffer-{1,2,3,4}): New tests. * test/lisp/dabbrev-resources/dabbrev-expand.el: * test/lisp/dabbrev-resources/INSTALL_BEGIN: New test resources. (cherry picked from commit f6c359cb66a0e9b851e3467b1ba9cab7efa8f744)
* Work on proced-tests.elLaurence Warne2024-10-301-3/+20
| | | | | | * test/lisp/proced-tests.el (proced--assert-process-valid-cpu-refinement-explainer): New function for explaining refinement test failures in greater detail.
* (with-peg-rules): Fix references to rulesets (bug#74018)Stefan Monnier2024-10-281-0/+14
| | | | | | | | | | | | | | | | | | | | | | | PEG rules get "compiled" to functions with name `peg-rule <RULE>`. `define-peg-ruleset` instead defines it PEG rules with name `peg-rule <RULESET> <RULE>`, so that they can be made visible by `with-peg-rules` simply by adding local aliases from `peg-rule <RULE>` to `peg-rule <RULESET> <RULE>`. Apparently when I added `define-peg-ruleset` I somehow failed to install some of the corresponding code in `with-peg-rules`, so the aliases were not installed, making it "impossible" to use rulesets. [ I still have no idea how this happened and/or where the missing code went, so I "recreated" it. ] * lisp/progmodes/peg.el (with-peg-rules): Install the aliases for the rulesets. (peg--translate-rule-body): Try and preserve location info when emitting a warning. * test/lisp/progmodes/peg-tests.el (peg-test-myrules): New ruleset. (peg-test-ruleset): New test.
* Fix flakey proced refine tests (Bug#73441)Laurence Warne2024-10-271-23/+20
| | | | | | | | | | | * test/lisp/proced-tests.el (proced-refine-test) (proced-refine-with-update-test): Use the much simpler CPU refinement for testing 'proced-refine'. The previous tests made the incorrect assumption that refining on the PID of process A only filtered the buffer to contain process A and its children, whereas in actuality the children of process A's children, their children, and so on will also be shown. (proced-update-preserves-pid-at-point-test): Mark as unstable.
* ; Fix typosStefan Kangas2024-10-272-2/+2
|
* ; Remove proced-tests.el instrumentation (Do not merge with master)Michael Albinus2024-10-261-3/+1
|
* ; * test/lisp/proced-tests.el (proced--within-buffer): Instrument macro.Michael Albinus2024-10-231-1/+3
| | | | Do not merge with master
* Fix error when splicing Eshell globs and a glob expands to itselfJim Porter2024-10-221-3/+13
| | | | | | | | | | | | This could happen when 'eshell-extended-glob' determines that a "glob" is not really a glob. This mainly happens for remote file names with a "~" in them, like "/ssh:remote:~/file.txt". * lisp/eshell/em-glob.el (eshell-extended-glob): Return a list when 'eshell-glob-splice-results' is non-nil. * test/lisp/eshell/em-glob-tests.el (em-glob-test/expand/splice-results) em-glob-test/expand/no-splice-results): Extend tests.
* * test/Makefile.in: Do not show emacs-module-tests.log by default.Michael Albinus2024-10-201-1/+1
|
* Fix c-ts-mode--anchor-prev-sibling (bug#73661)Yuan Fu2024-10-141-1/+1
| | | | | | | | * lisp/progmodes/c-ts-mode.el: (c-ts-mode--anchor-prev-sibling): Fix parentheses and use a slightly more efficient function. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: Replace the tab in the test code with spaces.
* Fix c-ts-mode indentation for initializer lists (bug#73661)Jørgen Kvalsvik2024-10-101-0/+39
| | | | | | | | | | | | | | | | | | | | | | | The intentation behavior differed between c-mode/c++-mode and *-ts-mode for initializer lists where the first element was not at beginning-of-line. The anchor-prev-sibling function gave up and returned nil, but it should (probably) anchor on the first element in the initializer list, such as this: return { v1, v2, ..., y1, y2, ... }; c-ts-mode behaved better and figured out how to align, but I added a test for a similar compound literal to prevent regressions. * lisp/progmodes/c-ts-mode.el (c-ts-mode--anchor-prev-sibling): Anchor at first sibling unless bol is found. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: New initializer list and compound literal test. Copyright-paperwork-exempt: yes
* Fix executing commands in Eshell using "env" with no local variablesJim Porter2024-09-291-0/+5
| | | | | | | | * lisp/eshell/esh-var.el (eshell/env): Throw 'eshell-replace-command' as needed. * test/lisp/eshell/esh-var-tests.el (esh-var-test/local-variables/env/no-locals): New test (bug#73479).
* Fix 'replace-regexp' in WDiredEli Zaretskii2024-09-211-0/+1
| | | | | | | | | | * src/search.c (Freplace_match): Revert the search.c part of the change from Apr 7, 2024, which aims to fix bug#65451, but causes bug#73018. Do not merge to master. * test/src/editfns-tests.el (editfns-tests--before/after-change-functions): Expect this test to fail.
* Fix treesit--merge-ranges (bug#73324)Yuan Fu2024-09-201-0/+5
| | | | | | * lisp/treesit.el (treesit--merge-ranges): Make sure that old ranges that intersects with START-END are actually discarded. * test/src/treesit-tests.el (treesit-range-merge): New test.
* Conservative heuristic for tree-sitter parser ranges (bug#73324)Yuan Fu2024-09-171-1/+1
| | | | | | | | * src/treesit.c (treesit_sync_visible_region): If the parser's original ranges don't overlap with visible region, give it a zero range, rather than don't set any range. * test/src/treesit-tests.el (treesit-range-fixup-after-edit): Test new behavior.
* ; Add even more tests for previous commitYuan Fu2024-09-151-6/+8
| | | | | * test/src/treesit-tests.el: (treesit-range-fixup-after-edit): Make the tests trickier.
* Fix treesit_sync_visible_region's range fixup code (bug#73264)Yuan Fu2024-09-151-1/+31
| | | | | | | | | | | | | | | | | | | | | new_ranges_head | v ( )->( )->( )->( )->( ) ^ ^ | | | lisp_ranges (loop head) | prev_cons -> set cdr to nil to cut of the rest result: ( )->( ) * src/treesit.c (treesit_sync_visible_region): Cut off this cons and the rest, not set the current range's end to nil. * test/src/treesit-tests.el: (treesit-range-fixup-after-edit): Add tests for all cases.
* Fix regression in widget-move (bug#72995)Stephen Berman2024-09-141-0/+17
| | | | | | | * lisp/wid-edit.el (widget-move): Avoid advancing point only if it is at the start of a widget at BOB. * test/lisp/wid-edit-tests.el (widget-test-widget-move-bug72995): New test.
* Correctly include fixed strings before a prefix wildcard in PCMSpencer Baugh2024-09-141-5/+12
| | | | | | | | | | | | | | | | In 03ac16ece40ba3e3ba805d6a61cc457d84bf3792 I fixed a bug with the PCM implementation of substring completion, relating to the handling of PCM wildcards. However, this fix was incomplete. This change completes the fix by also including a fixed string if it appears before a 'prefix' wildcard, even if 'try-completion' doesn't discover that fixed string grows to a unique completion. I discovered this bug while working on enhancements to PCM completion related to 'completion-pcm-leading-wildcard'. * lisp/minibuffer.el (completion-pcm--merge-completions): Include fixed strings before 'prefix wildcard. (Bug#72819) * test/lisp/minibuffer-tests.el (completion-substring-test-5): Add a test for this behavior.
* Fix range handling so it works for multibyte buffer (bug#73204)Yuan Fu2024-09-141-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here by multibyte buffer I mean buffer that includes non-ASCII characters. The problem is illustrated by this comment, which I copied from the source: ====================================================================== (ref:bytepos-range-pitfall) Suppose we have the following buffer content ([ ] is a unibyte char, [ ] is a multibyte char): [a][b][c][d][e][ f ] and the following ranges (denoted by braces): [a][b][c][d][e][ f ] { }{ } So far so good, now user deletes a unibyte char at the beginning: [b][c][d][e][ f ] { }{ } Oops, now our range cuts into the multibyte char, bad! ====================================================================== * src/treesit.c (treesit_debug_print_parser_list): Minor fix. (treesit_sync_visible_region): Change the way we fixup ranges, instead of using the bytepos ranges from tree-sitter, we use the cached lisp charpos ranges. (treesit_make_ts_ranges): New function. (Ftreesit_parser_set_included_ranges): Refactor out the new function treesit_make_ts_ranges. (Ftreesit_parser_included_ranges): Rather than getting the ranges from tree-sitter, just return the cached lisp ranges. * src/treesit.h (Lisp_TS_Parser): Add some comment. * test/src/treesit-tests.el (treesit-range-fixup-after-edit): New test.
* Don't fail uniquify-tests in non-version-controlled source treesMattias Engdegård2024-09-131-0/+1
| | | | | * test/lisp/uniquify-tests.el (uniquify-project-transform): Skip test if there is no project (bug#73205).
* eglot-test-rust-completion-exit-function: Fix failure in -Q sessionDmitry Gutov2024-09-101-4/+6
| | | | | | | * test/lisp/progmodes/eglot-tests.el (eglot--call-with-fixture): Check for buffer liveness (https://debbugs.gnu.org/72765#29). (eglot-test-rust-completion-exit-function): Don't expect snippet expansion to happen (no yasnippet in batch mode).
* Make json-serialize always return a unibyte string (bug#70007)Mattias Engdegård2024-09-081-24/+26
| | | | | | | | | | | | | The JSON format is defined as a byte sequence and will always be used as such, so returning a multibyte string makes little sense. * src/json.c (json_out_to_string): Remove. (Fjson_serialize): Return unibyte string. * test/src/json-tests.el (json-serialize/roundtrip) (json-serialize/roundtrip-scalars, json-serialize/string): Update tests. * doc/lispref/text.texi (Parsing JSON): Document. * etc/NEWS: Announce.
* Fix test failure in erc-networks-testsUlrich Müller2024-09-051-0/+2
| | | | | | * test/lisp/erc/erc-networks-tests.el (erc-networks--id-sort-buffers): Make sure that buffers have different timestamps. (Bug#73036)
* Support the new option in ruby-ts-mode tooDmitry Gutov2024-09-022-7/+18
| | | | | | | | | | | | | * etc/NEWS: Describe it here. * lisp/progmodes/ruby-ts-mode.el (ruby-ts--parent-call-or-bol): Support the option ruby-bracketed-args-indent here too (bug#60321). * test/lisp/progmodes/ruby-ts-mode-tests.el: Include ruby-bracketed-args-indent.rb as test examples. * test/lisp/progmodes/ruby-mode-resources/ruby-bracketed-args-indent.rb: Extend examples for better regression testing.
* Add new option ruby-bracketed-args-indentAaron Jensen2024-09-022-0/+33
| | | | | | | | * lisp/progmodes/ruby-mode.el (ruby-bracketed-args-indent): New option. (ruby-smie-rules): Use it (bug#60321). * test/lisp/progmodes/ruby-mode-resources/ruby-bracketed-args-indent.rb: New file. * test/lisp/progmodes/ruby-mode-tests.el: Use it for new case.
* * test/lisp/emacs-lisp/tabulated-list-tests.el: Add missing test.Juri Linkov2024-09-011-0/+27
| | | | (tabulated-list-groups-with-path): Add test for tabulated-list-groups.
* Fix redirecting Eshell output to symbols in some placesJim Porter2024-08-293-6/+24
| | | | | | | | | | | | | | | | | | | Do not merge to master. * lisp/eshell/esh-io.el (eshell-output-object-to-target): Don't require TARGET to be bound. * lisp/eshell/em-script.el (eshell-execute-file): Quote the output/error targets. * test/lisp/eshell/em-script-tests.el (eshell-execute-file-output): New variable. (em-script-test/execute-file/output-file) (em-script-test/execute-file/output-symbol): New tests. * test/lisp/eshell/esh-io-tests.el (eshell-test-file-string): Move to... * test/lisp/eshell/eshell-tests-helpers.el (eshell-test-file-string): ... here.
* Fix copyright years by hand (Bug#72809)Stefan Kangas2024-08-261-1/+1
| | | | These are dates that admin/update-copyright did not update.
* Indent ERT failure explanations rigidlyF. Jason Park2024-08-251-0/+54
| | | | | | | | | | | This also affects the listing of `should' forms produced by hitting the L key on a test button in an ERT buffer. * lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline): Indent the pretty-printed result to match the caller's current column as a reference indentation. * test/lisp/emacs-lisp/ert-tests.el (ert--pp-with-indentation-and-newline): New test. (Bug#72561)
* [Eglot] Stricter "expand common" behaviorDmitry Gutov2024-08-251-0/+30
| | | | | | | | | | | | | * lisp/progmodes/eglot.el (eglot--dumb-tryc): Check that the expanded string matches every completion strictly (bug#72705). And in the fallback case, check whether the table matches the original prefix at all. Return nil otherwise. * test/lisp/progmodes/eglot-tests.el (eglot-test-stop-completion-on-nonprefix) (eglot-test-try-completion-nomatch): Corresponding tests. * etc/EGLOT-NEWS: New entry.
* eglot-tests.el: New tests for existing completion behaviorDmitry Gutov2024-08-251-8/+86
| | | | | | | | * test/lisp/progmodes/eglot-tests.el (eglot-test-common-prefix-completion) (eglot-test-try-completion-inside-symbol) (eglot-test-rust-completion-exit-function): New tests. (eglot--wait-for-rust-analyzer): New function.
* Suppress shallow cloning on embaMichael Albinus2024-08-201-0/+1
| | | | | * test/infra/gitlab-ci.yml (variables): Set GIT_DEPTH to 0 in order to avoid shallow cloning.
* * test/infra/gitlab-ci.yml (.tree-sitter-template): Adapt changes.Michael Albinus2024-08-181-0/+3
|
* ; Backport gitlab-ci.yml from master (don't merge)Michael Albinus2024-08-141-3/+8
| | | | | | * test/infra/gitlab-ci.yml (.job-template): Remove cache:policy. (.build-template, .test-template): Add job specific cache:policy. (.tree-sitter-template): Adapt changes.
* Tag test in typescript-ts-mode-tests.el as unstableMichael Albinus2024-08-131-0/+1
| | | | | * test/lisp/progmodes/typescript-ts-mode-tests.el (typescript-ts-mode-test-indentation): Tag it as :unstable on emba.
* Fix missing type checks before specbindMattias Engdegård2024-08-031-0/+8
| | | | | | | | | | | This fixes bugs that crashed Emacs when the Lisp interpreter was fed bad code. * src/eval.c (FletX, Flet, internal_lisp_condition_case) (funcall_lambda): Hoist symbol-with-pos elimination and type checks to a dominating position for efficiency. This also plugs at least two typing holes. (Mea culpa.) * test/src/eval-tests.el (eval-bad-specbind): New regression test.
* Fix c++-ts-mode indentation for templace (bug#72263)Yuan Fu2024-07-311-0/+28
| | | | | | * lisp/progmodes/c-ts-mode.el: (c-ts-mode--indent-styles): Add rule for template. * test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add test.
* ; cperl-mode.el: Fix fontification of flip-flop (Bug#72296)Harald Jörg2024-07-251-0/+17
| | | | | | | * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Prevent a movement of point from bleeding into a following clause. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-72296): Add a test for the flip-flop operator with code from the report.
* Standardize possessive apostrophe usage in manuals, docs, and commentsStefan Kangas2024-07-254-4/+4
| | | | | See the note in admin/notes/documentation. Ref: https://lists.gnu.org/r/emacs-devel/2012-02/msg00649.html
* Fix Tramp IPv6 handling in testsMichael Albinus2024-07-221-27/+55
| | | | | | | | | | | | | | | | | | * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): * lisp/net/tramp-sh.el (tramp-maybe-open-connection): Improve message. * lisp/net/tramp-integration.el (shortdoc): Add further examples of `file-remote-p'. * lisp/net/tramp.el (tramp-handle-file-remote-p): Extend docstring. * test/lisp/net/tramp-tests.el (tramp-test02-file-name-dissect) (tramp-test02-file-name-dissect-simplified) (tramp-test02-file-name-dissect-separate): Extend tests. (tramp-test06-directory-file-name) (tramp-test26-file-name-completion) (tramp-test26-interactive-file-name-completion): Better handling of IPv6 hosts.