summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* 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 Edebug specification for inline functions (Bug#53068).Philipp Stephani2022-01-131-0/+10
| | | | | | | * lisp/emacs-lisp/inline.el (inline-quote): Fix Edebug specification. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-inline): New unit test.
* Revert "Fix closure-conversion of shadowed captured lambda-lifted vars"Mattias Engdegård2022-01-122-195/+0
| | | | | | | This reverts commit 3ec8c8b3ae2359ceb8135b672e86526969c16b7e. It was committed to a stable branch without prior discussion; see bug#53071.
* Fix closure-conversion of shadowed captured lambda-lifted varsMattias Engdegård2022-01-122-0/+195
| | | | | | | | | | | | | | | | | Lambda-lifted variables (ones passed explicitly to lambda-lifted functions) that are also captured in an outer closure and shadowed were renamed incorrectly (bug#51982). Reported by Paul Pogonyshev. * lisp/emacs-lisp/cconv.el (cconv--lifted-arg): New. (cconv-convert): Provide correct definiens for the closed-over variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): * test/lisp/emacs-lisp/cconv-tests.el (cconv-tests--intern-all) (cconv-closure-convert-remap-var): Add tests. (cherry picked from commit 45252ad8f932c98a373ef0ab7f3363a3e27ccbe4)
* ; Fix tabulated-list-mode tests after revertStefan Kangas2022-01-111-22/+37
| | | | | * test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-print, tabulated-list-sort): Fix tests.
* ; Copyright year fixesGlenn Morris2022-01-011-1/+1
|
* ; Add 2022 to copyright years.Eli Zaretskii2022-01-0164-64/+64
|
* * test/lisp/dabbrev-tests.el: Use 'kbd' for readable keys.Juri Linkov2021-10-211-1/+1
| | | | | | | (dabbrev-expand-test, dabbrev-completion-test) (dabbrev-completion-test-with-argument): Use 'kbd' to format keys for 'execute-kbd-macro'. (dabbrev-expand-test): Fix docstring.
* ; * test/lisp/emacs-lisp/bytecomp-tests.el: remove ineffective \Mattias Engdegård2021-09-301-1/+1
|
* checkdoc: Allow Lisp symbols to start a messageStefan Kangas2021-09-281-0/+37
| | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Allow Lisp symbols to start a message. (checkdoc--error-bad-format-p): New helper function. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-test-error-format-is-good) (checkdoc-test-error-format-is-bad): New helper functions. (checkdoc-tests-error-message-bad-format-p) (checkdoc-tests-error-message-bad-format-p/defined-symbols) (checkdoc-tests-error-message-bad-format-p/not-capitalized): New tests.
* Get a `package-test-signed` to work againdickmao2021-09-274-49/+28
| | | | | | | | The test signing key succumbed to either expiration or bitrot. I hope I didn't just publish my secret key to the world. * test/lisp/emacs-lisp/package-resources/key.pub: Refresh. * test/lisp/emacs-lisp/package-resources/key.sec: Refresh.
* Move test-cl-flet-indentation to the right fileLars Ingebrigtsen2021-09-271-11/+0
|
* Move two incorrectly named test filesStefan Kangas2021-09-261-3/+2
| | | | | | | * test/lisp/emacs-lisp/tabulated-list-test.el: Move from here... * test/lisp/emacs-lisp/tabulated-list-tests.el: ...to here. * test/lisp/url/url-handlers-test.el: Move from here... * test/lisp/url/url-handlers-tests.el: ...to here.
* ; Minor stylistic checkdoc fixes in test/**/*.elStefan Kangas2021-09-2626-55/+71
|
* Rename "Homepage" field to "Website" in package descriptionStefan Kangas2021-09-261-4/+4
| | | | | | | | | | | * lisp/emacs-lisp/package.el (describe-package-1): Rename "Homepage" field to "Website". * test/lisp/emacs-lisp/package-tests.el (package-test-describe-package) (package-test-describe-installed-multi-file-package) (package-test-describe-non-installed-package) (package-test-describe-non-installed-multi-file-package): Update tests.
* Add test for lm-websiteStefan Kangas2021-09-261-0/+8
| | | | | | * lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx. * test/lisp/emacs-lisp/lisp-mnt-tests.el (lm--tests-lm-website): New test.
* Warn about overly long docstring in lambdaStefan Kangas2021-09-261-2/+1
| | | | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-length-warn): Warn about overly long docstring in lambda. (Bug#44858) (byte-compile--wide-docstring-p): Improve comment. * test/lisp/emacs-lisp/bytecomp-tests.el ("warn-wide-docstring-defun.el"): Update to test for the above new warning.
* Avoid false positives in bytecomp docstring width warningStefan Kangas2021-09-261-0/+24
| | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p): Ignore more function argument lists. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests-byte-compile--wide-docstring-p): New test.
* Unbreak ert testsStefan Kangas2021-09-261-17/+18
| | | | | * test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-print) (tabulated-list-sort): Update tests for recent change.
* Fix byte-compiler crash for legal dynamic-binding codeMattias Engdegård2021-09-251-0/+8
| | | | | | | | | | This should really be taken care of by a syntax normalisation step in the frontend, but there is no such step for non-lexbind code yet. * lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Tolerate bindingsa without initialising expressions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* Constant-propagate variables bound outside loopsMattias Engdegård2021-09-251-0/+37
| | | | | | | | | | | | | | Previously, variables bound outside `while` loops were not substituted inside even in the absense of mutation. Add the necessary mutation checking inside loops to allow propagation of values and aliased variables. * lisp/emacs-lisp/byte-opt.el (byte-optimize--inhibit-outside-loop-constprop): New variable. (byte-optimize-form-code-walker): First traverse each loop without substitution to discover mutation, then without restrictions. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test-loop): New. (bytecomp-tests--test-cases): Add test cases.
* Use ambient lexical-binding value in ert-deftest body (bug#50738)Mattias Engdegård2021-09-251-0/+4
| | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-deftest): Evaluate the body of `ert-deftest` with the `lexical-binding` value of the source file (or more precisely the value in force when the definition is evaluated), which is what everyone expected, instead of always using dynamic binding which is what they got until now. * test/lisp/emacs-lisp/ert-tests.el (ert-test-deftest-lexical-binding-t): New test.
* Indent bodies of local function definitions properly in elisp-modeakater2021-09-251-0/+11
| | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-function): Check for local defforms (`cl-flet' and `cl-labels'). (lisp--local-defform-body): New auxiliary function (bug#9622).
* Fix recently introduced bug in checkdocStefan Kangas2021-09-241-1/+4
| | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Fix recently introduced bug where some abbreviations weren't recognized. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-in-abbrevation-p/basic-case): Extend test.
* Avoid jumping too far in checkdoc-in-abbreviation-pStefan Kangas2021-09-231-16/+18
| | | | | | | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): Use 'forward-ward' instead of 'forward-sexp' to avoid jumping too far in some situations. (Bug#50731) * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests--abbrev-test): New helper function. (checkdoc-tests-in-abbrevation-p/basic-case): Rename from 'checkdoc-tests-in-abbrevation-p'. (checkdoc-tests-in-abbrevation-p/with-parens) (checkdoc-tests-in-abbrevation-p/with-escaped-parens): Use above new helper function. (checkdoc-tests-in-abbrevation-p/single-char) (checkdoc-tests-in-abbrevation-p/with-em-dash) (checkdoc-tests-in-abbrevation-p/incorrect-abbreviation): New tests.
* Change how thread-first/thread-last indent the first argumentLars Ingebrigtsen2021-09-221-10/+10
| | | | | | | | | | | | | | * lisp/doc-view.el (doc-view--current-cache-dir): Reindent. * lisp/emacs-lisp/subr-x.el (thread-first): (thread-last): Change indentation to match examples. (internal--build-binding): Reindent. * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-test-thread-first-function-names-are-threaded): (subr-x-test-thread-first-examples): (subr-x-test-thread-last-function-names-are-threaded): (subr-x-test-thread-last-examples): Reindent.
* Don't quote nil and t in doc strings and commentsLars Ingebrigtsen2021-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/src/minibuf-tests.el (test-try-completion-ignore-case): * test/lisp/url/url-auth-tests.el (url-auth-test-digest-auth-retrieve-cache): * test/lisp/subr-tests.el (subr-tests-add-hook-depth): * test/lisp/so-long-tests/so-long-tests.el (so-long-tests-invisible-buffer-function): * test/lisp/emacs-lisp/tabulated-list-test.el (tabulated-list-sort): * src/xfaces.c: * src/process.c (Finterrupt_process): (syms_of_process): * src/minibuf.c (Fread_from_minibuffer): (Fcompleting_read): (syms_of_minibuf): * src/dispnew.c (syms_of_display): * src/data.c: * lisp/so-long.el (so-long--hack-local-variables): * lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions): (elisp--xref-find-definitions): * lisp/org/ox-html.el (org-html-htmlize-output-type): * lisp/org/org-agenda.el (org-agenda-do-in-region): * lisp/net/tramp.el: * lisp/minibuffer.el (set-minibuffer-message): * lisp/isearch.el (isearch-wrap-pause): (isearch-repeat-on-direction-change): * lisp/emacs-lisp/timer.el (timer): * lisp/emacs-lisp/package.el (package-read-archive-contents): * lisp/emacs-lisp/faceup.el (faceup-next-property-change): * lisp/emacs-lisp/comp.el (comp-func): * lisp/emacs-lisp/comp-cstr.el (comp-cstr-empty-p): * lisp/emacs-lisp/cl-macs.el (cl-do): (cl-do*): (cl--self-tco): * lisp/emacs-lisp/bytecomp.el (byte-compile-unresolved-functions): (byte-compile-cond-jump-table): Don't quote t and nil.
* Consistently test alist keys with equal in map.elBasil L. Contovounesios2021-09-211-5/+29
| | | | | | | | | | | | | | | | | * etc/NEWS: Announce new default behavior of map-elt and map-delete on alists. * lisp/emacs-lisp/map.el: Bump to version 3.2. (map-elt): Test alist keys with equal by default. Betray a little bit more information in the docstring on which functions are used for which map types. (Bug#47368) (map-put): Update docstring accordingly. (map--plist-delete): Consistently test plist keys with eq. (map-delete): Consistently test alist keys with equal. * test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn): Update for new map-elt behavior. (test-map-put!-alist, test-map-delete-alist): New tests.
* checkdoc: 'y-or-n-p' no longer needs spaceStefan Kangas2021-09-171-0/+30
| | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Change 'y-or-n-p' check to accept prompt ending with both "? " or "?", that is, it no longer needs the space. (Bug#50621) (checkdoc--fix-y-or-n-p): New helper function. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-fix-y-or-n-p) (checkdoc-tests-fix-y-or-n-p/no-change) (checkdoc-tests-fix-y-or-n-p/with-space): New tests.
* ; * test/lisp/emacs-lisp/seq-tests.el: Remove duplicate test.Stefan Kangas2021-09-171-5/+0
|
* Add new sequence function 'seq-union'Stefan Kangas2021-09-171-0/+32
| | | | | | | | * lisp/emacs-lisp/seq.el (seq-union): New function. * doc/lispref/sequences.texi (Sequence Functions): * lisp/emacs-lisp/shortdoc.el (sequence): Document above new function. * test/lisp/emacs-lisp/seq-tests.el (test-seq-union): New test.
* Improve checkdoc abbreviation handlingStefan Kangas2021-09-131-0/+24
| | | | | | | | | | | | * lisp/emacs-lisp/checkdoc.el (checkdoc-in-abbreviation-p): New helper function. (checkdoc-sentencespace-region-engine): Fix handling abbreviations after escaped parenthesis. * test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-in-abbrevation-p) (checkdoc-tests-in-abbrevation-p/with-parens) (checkdoc-tests-in-abbrevation-p/with-escaped-parens): New tests.
* Propagate aliased lexical variables in byte compilerMattias Engdegård2021-09-111-0/+44
| | | | | | | | | | | | | | | | | | | | | | Replace uses of a variable aliasing another variable with that aliased variable, to allow for variable removal when possible. This also enables opportunities for other optimisations. Example: (let ((y x)) (f y)) => (f x) The optimisation is only performed if both aliased and aliasing variables are lexically bound. Shadowing bindings are α-renamed when necessary for correctness. Example: (let* ((b a) (a EXPR)) (f a b)) => (let* ((a{new} EXPR)) (f a{new} a)) * lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New. (byte-optimize-form-code-walker): Cancel aliasing upon mutation. (byte-optimize--rename-var-body, byte-optimize--rename-var): New. (byte-optimize-let-form): Add the optimisation. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add relevant test cases.
* Optimise `member` and `assoc` (etc) with constant empty listMattias Engdegård2021-09-061-0/+15
| | | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-assq): New. (byte-optimize-member, byte-optimize-assoc, byte-optimize-memq): When the list argument is constant nil, the result is always nil. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test cases.
* Autoload cl-struct-slot-infoLars Ingebrigtsen2021-09-051-1/+0
| | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-info): Autoload (bug#50301). * test/lisp/emacs-lisp/memory-report-tests.el: Don't require cl-macs.
* Avoid cl-lib alias for cadadr and friendsStefan Kangas2021-09-031-2/+2
| | | | | | | | | | | | | | | | | | * lisp/edmacro.el (edmacro-fix-menu-commands): * lisp/frameset.el (frameset-move-onscreen): * lisp/htmlfontify.el (hfy-face-at, hfy-merge-adjacent-spans) (hfy-mark-tag-names): * lisp/mail/footnote.el (footnote--make-hole) (footnote-back-to-message): * lisp/net/eudc.el (eudc-get-email, eudc-get-phone): * lisp/net/rcirc.el (rcirc-make-trees, rcirc-handler-333) (rcirc-authenticate): * lisp/play/5x5.el (5x5-draw-grid, 5x5-solver): * lisp/play/decipher.el (decipher-insert-frequency-counts): * lisp/ses.el (ses-relocate-range): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-step-into-macro-error) (edebug-tests-error-stepping-into-subr): Avoid using cl-lib aliases for cadadr and friends that now reside in subr.el.
* Move cl-lib tests for caaXr to subr-tests.elStefan Kangas2021-09-031-16/+0
| | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (cl-test-caaar) (cl-test-caadr): Move tests using a cl-lib alias from here... * test/lisp/subr-tests.el (subr-test-caaar, subr-test-caadr): ...to here. The functions under test are in subr.el.
* Fix memory-report test failureLars Ingebrigtsen2021-09-031-0/+1
| | | | * test/lisp/emacs-lisp/memory-report-tests.el: Fix test build failure.
* memory-report: support calculating size for structuresYikai Zhao2021-09-021-0/+8
| | | | | * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Add support for cl-defstruct types (bug#50301).
* Fix (setf (map-elt map key) (my-func))Lars Ingebrigtsen2021-09-011-0/+9
| | | | | * lisp/emacs-lisp/map.el (map-elt): Ensure that the value isn't referenced more than once (bug#50290).
* Revert "Add macro `seq-setq`."Lars Ingebrigtsen2021-08-141-24/+0
| | | | | | This reverts commit a8a3fd8f8e27089ac46bf98e534529ff03f679a5. The same patch was applied twice. Remove the second instance.
* Add macro `seq-setq`.Earl Hyatt2021-08-141-0/+24
| | | | | | | * doc/lispref/sequences.texi (seq-setq): Document this macro. * test/lisp/emacs-lisp/seq-tests.el (test-seq-setq): Test this macro (bug#50053).
* Add macro `seq-setq`.Earl Hyatt2021-08-141-0/+24
| | | | | | | | | * doc/lispref/sequences.texi (seq-setq): Document this macro. * lisp/emacs-lisp/seq.el (seq-setq): New macro. * test/lisp/emacs-lisp/seq-tests.el (test-seq-setq): Test this macro (bug#50053).
* Fix memory-report counting of vector/hash table sizesYikai Zhao2021-08-141-0/+16
| | | | | | | * lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Count element values in vectors and hash tables. Copyright-paperwork-exempt: yes
* Fix merging of ambiguous nil mapsBasil L. Contovounesios2021-08-141-8/+16
| | | | | | | | | | | | | | | * lisp/emacs-lisp/map.el: Bump version to 3.1. (map--merge): New merging subroutine that uses a hash table in place of lists, for both efficiency and avoiding ambiguities (bug#49848). (map-merge): Rewrite in terms of map--merge. (map-merge-with): Ditto. This ensures that FUNCTION is called whenever two keys are merged, even if they are not eql (which could happen until now). It also makes map-merge-with consistent with map-merge, thus achieving greater overall predictability. * etc/NEWS: Announce this weakening of guarantees. * test/lisp/emacs-lisp/map-tests.el (test-map-merge) (test-map-merge-with): Don't depend on specific orderings. Test that nil is correctly merged into a plist.
* * lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Handle multi-addressesStefan Monnier2021-08-121-0/+36
| | | | (lm-authors, lm-maintainers): Adjust accordingly.
* * lisp/emacs-lisp/pcase.el (pcase-setq): Align its semantics with `pcase-let`Stefan Monnier2021-08-121-8/+7
| | | | | * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-setq): Rename from pcase-setq and ajust accordingly.