summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Make cl-print respect print-level and print-length (bug#31559)Gemini Lasswell2018-06-041-0/+25
| | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print--depth): New variable. (cl-print-object) <cons>: Print ellipsis if printing depth greater than 'print-level' or length of list greater than 'print-length'. (cl-print-object) <vector>: Truncate printing with ellipsis if vector is longer than 'print-length'. (cl-print-object) <cl-structure-object>: Truncate printing with ellipsis if structure has more slots than 'print-length'. (cl-print-object) <:around>: Bind 'cl-print--depth'. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-3, cl-print-tests-4): New tests. (cherry picked from commit 0f48d18fd2a30f29cc3592a835d2a2254c9b0afb)
* Fix cl-print for circular sublists (Bug#31146)Noam Postavsky2018-06-031-0/+10
| | | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object) <cons>: Push each element of list being printed onto cl-print--currently-printing. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle-2): New test. (cherry picked from commit b8aa7ecf54c9b164a59f1b0e9f9fe90531dadd20)
* Adjust eieio persistence tests for expected failureEric Abrahamsen2018-03-221-4/+12
| | | | | | | | * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (eieio-test-persist-hash-and-vector, eieio-test-persist-interior-lists): Persistence does not currently handle deeply-nested objects. Expect current failures, and mark for future fixes.
* Add new tests for eieio persistencePierre Téchoueyres2018-03-221-10/+103
| | | | | | | | * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el: (hash-equal): New comparison test for hash-tables. (persist-test-save-and-compare): Use test for hash-tables. (eieio-test-persist-hash-and-vector, eieio-test-persist-interior-lists): New tests.
* Revert last commitMichael Heerdegen2018-03-061-121/+111
| | | | | This reverts commit af4697faa1f5b643f63a9ea61aa205a4c1432e23. It's too late for this to be in the release.
* Define if-let* and derivatives as aliases for if-let etcMichael Heerdegen2018-03-061-111/+121
| | | | | | | | | | | | | | | | | | This commit reverts declaring `if-let' and `when-let' obsolete in favor of the new `if-let*' and `when-let*' versions because of the compiler warning mess (Bug#30039). Instead we make foo-let* aliases for foo-let. The old single-tuple variable spec case is still supported for backward compatibility. * lisp/emacs-lisp/subr-x.el (if-let, when-let): Don't declare obsolete. Tweak edebug specs. (and-let): Renamed from `and-let*' for compatibility with the names `if-let' and `when-let'. (if-let*, when-let*, and-let*): Define as aliases for `if-let', `when-let' and `and-let'. * test/lisp/emacs-lisp/subr-x-tests.el (if-let-single-tuple-case-test) (when-let-single-tuple-case-test): New tests for the single-binding tuple case. In the whole file, prefer the names without "*".
* ; Spelling fixPaul Eggert2018-01-221-1/+1
|
* Handle case-insensitive filenames for load-path shadows (Bug#5845)Noam Postavsky2018-01-183-0/+51
| | | | | | | | | * lisp/emacs-lisp/shadow.el (load-path-shadows-find): Check for shadowing with case-insensitive matching for files of case-insensitive directories (as determined by `file-name-case-insensitive-p'). * test/lisp/emacs-lisp/shadow-tests.el: New test. * test/lisp/emacs-lisp/shadow-resources/p1/foo.el: * test/lisp/emacs-lisp/shadow-resources/p2/FOO.el: New test files.
* Tag some unstable tests, and skip by default (bug#24503)Glenn Morris2018-01-092-3/+3
| | | | | | | | | | | | | * Makefile.in (check-all): New phony target. * test/Makefile.in (SELECTOR_DEFAULT, SELECTOR_EXPENSIVE): Also skip unstable tests. (SELECTOR_ALL): New variable. (check-all): New phony target. * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el (eieio-test-method-order-list-6): * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-37-obsolete-name-in-constructor): Mark as unstable rather than skipping on hydra.nixos.org.
* Update copyright year to 2018Paul Eggert2018-01-0138-38/+38
| | | | Run admin/update-copyright.
* * test/lisp/emacs-lisp/derived-tests.el: Fix copy&paste leftoversStefan Monnier2017-12-181-3/+2
|
* * lisp/subr.el (delayed-after-hook-functions): Rename from ...-formsStefan Monnier2017-12-181-0/+44
| | | | | | (run-mode-hooks): `funcall` the functions instead of `eval`ing the forms. * lisp/emacs-lisp/derived.el (define-derived-mode): Push functions rather than forms (bug#29679).
* Partially revert "Mention new strictness for &optional, &rest..."Noam Postavsky2017-12-151-31/+0
| | | | | | | | | | | | | The changes to cl argument parsing are not backwards compatible, and cause inconvenience when writing macros (e.g., instead of doing '&aux ,@auxargs', some more complicated conditionals would be required). The `cl-defstruct' macro makes use of this convenience when defining empty structs (Bug#29728). * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): (cl--do-&aux, cl--do-arglist): Undo strict checking of &rest, &key, and &aux. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): Remove test.
* Mention new strictness for &optional, &rest in arglists (Bug#29165)Noam Postavsky2017-12-131-0/+31
| | | | | | | | | | * etc/NEWS: Explain that '&optional' not followed by a variable is now an error. * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda, cl--do-&aux) (cl--do-arglist): Also reject '&optional', '&rest', or '&aux' not followed by a variable for consistency. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-bad-arglist): New test.
* Fix Edebug specs for if-let* and and-let* (Bug#29236)Gemini Lasswell2017-11-261-1/+1
| | | | | | | | | | | * test/lisp/emacs-lisp/subr-x.el (if-let*, if-let): Change Edebug spec to cause Edebug to instrument tests the results of which are not bound to symbols (the (VALUEFORM) case). (and-let*): Change Edebug spec to allow empty body. *test/lisp/emacs-lisp/subr-x-tests.el: (subr-x-and-let*-test-group-1): Add missing quote to erroneous form so Edebug will work on this test.
* Fix Edebug's handling of dotted specs (bug#6415)Gemini Lasswell2017-11-262-0/+18
| | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-destructuring-bind): Use cl-macro-list1 instead of cl-macro-list in Edebug spec. * lisp/emacs-lisp/edebug.el (edebug-after-dotted-spec): Delete unused variable. (edebug-dotted-spec): Add docstring. (edebug-match-specs): Allow &optional and &rest specs to match nothing at the tail of a dotted form. Handle matches of dotted form tails which return non-lists. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-dotted-forms): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el: (edebug-test-code-use-destructuring-bind): New function.
* Require seq in rmc.elTino Calancha2017-10-271-0/+41
| | | | | * lisp/emacs-lisp/rmc.el: Require seq (Bug#28975). * test/lisp/emacs-lisp/rmc-tests.el (test-read-multiple-choice): Add test.
* Fix Edebug specs for map-let and with-maps-doGemini Lasswell2017-10-241-1/+1
| | | | | * lisp/emacs-lisp/map.el (map-let): Fix Edebug spec (bug#24777). * test/lisp/emacs-lisp/map-tests.el (with-maps-do): Fix Edebug spec.
* Don't fill keywords after Emacs Lisp docstringAlexander Gramiak2017-10-221-0/+31
| | | | | | | | | | | | This approach does mean that keywords that have spaces before them inside of docstrings aren't filled, but I think this is should be fine until Bug#28937 is fixed. * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Add a colon to paragraph-start unconditionally, but require that it follows at least one space. (Bug#24622) * test/lisp/emacs-lisp/lisp-tests.el: New tests for Bug#24622 and Bug#7751.
* Test that advice doesn't trigger bytecomp warnings (Bug#28803)John Williams2017-10-211-0/+11
| | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-no-warnings-with-advice): New test. Copyright-paperwork-exempt: yes
* Fix dynamic binding wrapper in iter-lambda (bug#25965)Gemini Lasswell2017-10-051-0/+10
| | | | | | | * lisp/emacs-lisp/generator.el (cps--make-dynamic-binding-wrapper): Remove extra evaluation of form. * test/lisp/emacs-lisp/generator-tests.el (cps-iter-lambda-with-dynamic-binding): New test.
* Fix slot typecheck in eieio-persistentEric Abrahamsen2017-09-301-0/+22
| | | | | | | | | | | | * lisp/emacs-lisp/eieio-base.el (eieio-persistent-slot-type-is-class-p): An `or' form can specify multiple potential classes (or null) as valid types for a slot, but previously only the final element of the `or' was actually checked. Now returns all valid classes in the `or' form. (eieio-persistent-validate/fix-slot-value): Check if proposed value matches any of the valid classes. * test/lisp/emacs-lisp/eieio-tests/eieio-test-persist.el (eieio-test-multiple-class-slot): Test this behavior.
* Fix subr-x-tests when running from elcNoam Postavsky2017-09-251-2/+7
| | | | | * test/lisp/emacs-lisp/subr-x-tests.el (subr-x-and-let*-test-group-1): Use `eval' around the `should-error' cases.
* ; Spelling and URL fixesPaul Eggert2017-09-232-4/+4
|
* Add tests for EdebugGemini Lasswell2017-09-212-0/+1033
| | | | | * tests/lisp/emacs-lisp/edeug-tests.el: New file. * tests/lisp/emacs-lisp/edebug-resources/edebug-test-code.el: New file.
* Prefer HTTPS to FTP and HTTP in documentationPaul Eggert2017-09-1334-42/+42
| | | | | | | | | | | | | Most of this change is to boilerplate commentary such as license URLs. This change was prompted by ftp://ftp.gnu.org's going-away party, planned for November. Change these FTP URLs to https://ftp.gnu.org instead. Make similar changes for URLs to other organizations moving away from FTP. Also, change HTTP to HTTPS for URLs to gnu.org and fsf.org when this works, as this will further help defend against man-in-the-middle attacks (for this part I omitted the MS-DOS and MS-Windows sources and the test tarballs to keep the workload down). HTTPS is not fully working to lists.gnu.org so I left those URLs alone for now.
* Implement and-let*Mark Oteiza2017-09-121-148/+160
| | | | | | | | | | | | | | | | | | | | This also includes changes to if-let and when-let. The single tuple special case is ambiguous, and binding a symbol to nil is not as useful as binding it to its value outside the lexical scope of the binding. (Bug#28254) * etc/NEWS: Mention. * lisp/emacs-lisp/subr-x.el (internal--listify): (internal--build-binding-value-form): Extend to account for solitary symbols and (EXPR) items in binding varlist. (if-let*, when-let*): Nix single tuple case and incumbent bind-symbol-to-nil behavior. (and-let*): New macro. (if-let, when-let): Mark obsolete. Redefine in terms of if-let*, so they implicitly gain the new features without breaking existing code. * test/lisp/emacs-lisp/subr-x-tests.el: Adjust tests for: lack of single-tuple special case, lack of binding solitary symbols to nil, and the introduction of uninterned symbols for (EXPR) bindings. Add SRFI-2 test suite adapted to Elisp.
* Add tests for cl-macs.el (Bug#27559)Alexander Gramiak2017-08-212-8/+502
| | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-loop): Remove duplicate. (cl-loop-destructuring-with): Move to cl-macs-tests.el. * test/lisp/emacs-lisp/cl-macs-tests.el: New file.
* Clean up temp files after some testsGlenn Morris2017-08-141-1/+3
| | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--with-temp-file): Also delete .elc file if present. * test/lisp/progmodes/etags-tests.el (etags-buffer-local-tags-table-list): Delete temp file at end.
* Don't define gv expanders in compiler's runtime (Bug#27016)Noam Postavsky2017-08-071-0/+147
| | | | | | | | This prevents definitions being compiled from leaking into the current Emacs doing the compilation. * lisp/emacs-lisp/gv.el (gv-define-expander): Use function-put instead of `put' with `eval-and-compile'. * test/lisp/emacs-lisp/gv-tests.el: New tests.
* Let the cl-typep effects of defclass work during compilation (Bug#27718)Noam Postavsky2017-08-071-12/+0
| | | | | | | | | * lisp/emacs-lisp/eieio.el (defclass): Use `define-symbol-prop' instead of `put'. * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-tests--dummy-function): Remove. (eieio-test-25-slot-tests, eieio-test-23-inheritance-check): Don't expect to fail if compiled.
* Let `define-symbol-prop' take effect during compilationStefan Monnier2017-08-071-0/+17
| | | | | | | | | | | | * src/fns.c (syms_of_fns): New variable `overriding-plist-environment'. (Fget): Consult it. * lisp/emacs-lisp/bytecomp.el (byte-compile-close-variables): Let-bind it to nil. (byte-compile-define-symbol-prop): New function, handles compilation of top-level `define-symbol-prop' and `function-put' calls by putting the symbol setting into `overriding-plist-environment'. Co-authored-by: Noam Postavsky <npostavs@gmail.com>
* Add a test of handling of circular values to testcover-testsGemini Lasswell2017-08-071-0/+10
| | | | | | * test/lisp/emacs-lisp-testcover-resources/testcases.el (testcover-testcase-cyc1): New function. (testcover-tests-circular-lists-bug-24402): New test.
* ; Avoid test failures when running from compiled test filesNoam Postavsky2017-08-072-0/+20
| | | | | | | | * test/lisp/dom-tests.el: Require `subr-x' during runtime as well. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-defstruct-record): * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-23-inheritance-check, eieio-test-25-slot-tests): Mark as expected to fail when byte-compiled.
* Catch argument and macroexpansion errors in ertAlexander Gramiak2017-08-071-0/+9
| | | | | | | | | | | | This kludge catches errors caused by evaluating arguments in ert's should, should-not, and should-error macros; it also catches macroexpansion errors inside of the above macros (Bug#24402). * lisp/emacs-lisp/ert.el: (ert--should-signal-hook): New function. (ert--expand-should-1): Catch macroexpansion errors. * test/lisp/emacs-lisp/ert-tests.el (ert-test-should-error-argument) (ert-test-should-error-macroexpansion): Tests for argument and expansion errors.
* ; Fix map-tests when compiledNoam Postavsky2017-08-041-6/+10
| | | | | | * test/lisp/emacs-lisp/map-tests.el (test-map-elt-testfn) (test-map-put-testfn-alist): Make sure the lookup key is really non-eq to the map's key, even if the code is compiled.
* * lisp/subr.el (define-symbol-prop): New functionStefan Monnier2017-07-281-1/+1
| | | | | | | | (symbol-file): Make it find symbol property definitions. * lisp/emacs-lisp/pcase.el (pcase-defmacro): * lisp/emacs-lisp/ert.el (ert-set-test): Use it instead of `put'. (ert-describe-test): Adjust call to symbol-file accordingly.
* * lisp/subr.el (method-files): Move function to cl-generic.elStefan Monnier2017-07-281-0/+24
| | | | | | | | * lisp/emacs-lisp/cl-generic.el (cl-generic-p): New function. (cl--generic-method-files): New function, moved from subr.el. * lisp/emacs-lisp/edebug.el (edebug-instrument-function): Use them. * test/lisp/emacs-lisp/cl-generic-tests.el: * test/lisp/subr-tests.el: Move and adjust method-files tests accordingly.
* Add 'rx' pattern for pcase.Philipp Stephani2017-07-231-0/+10
| | | | | * lisp/emacs-lisp/rx.el (rx): New pcase macro. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add unit test.
* Use a more specific test for running on hydra.nixos.orgGlenn Morris2017-07-182-2/+2
| | | | | | | | | | | * lisp/emacs-lisp/ert.el (ert-summarize-tests-batch-and-exit): * test/Makefile.in (WRITE_LOG): * test/lisp/filenotify-tests.el: * test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el (eieio-test-method-order-list-6): * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-37-obsolete-name-in-constructor): * test/lisp/net/tramp-tests.el: Replace NIX_STORE with EMACS_HYDRA_CI.
* alist-get: Add optional arg TESTFNTino Calancha2017-07-171-0/+12
| | | | | | | | | | | | If TESTFN is non-nil, then it is the predicate to lookup the alist. Otherwise, use 'eq' (Bug#27584). * lisp/subr.el (alist-get): Add optional arg FULL. * lisp/emacs-lisp/map.el (map-elt, map-put): Add optional arg TESTFN. * lisp/emacs-lisp/gv.el (alist-get): Update expander. * doc/lispref/lists.texi (Association Lists): Update manual. * etc/NEWS: Announce the changes. * test/lisp/emacs-lisp/map-tests.el (test-map-put-testfn-alist) (test-map-elt-testfn): New tests.
* Fix lisp-comment-indent for single-semicolon caseNoam Postavsky2017-07-061-0/+26
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): Only check for open paren if we're looking at multiple comment characters. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-comment-indent-1) (lisp-comment-indent-2): New tests.
* Don't redundantly cl-print arglist in function docstring againNoam Postavsky2017-06-291-1/+1
| | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print-object): Don't print arglist part of docstring. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-tests-1): Update test accordingly.
* Improve ert backtrace recordingNoam Postavsky2017-06-291-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Change ert to use the new `backtrace-frames' function instead of collecting frames one by one with `backtrace-frame'. Additionally, collect frames starting from `signal' instead the somewhat arbitrary "6 from the bottom". Skipping 6 frames would skip the expression that actually caused the signal that triggered the debugger. Possibly 6 was chosen because in the case of a failed test, the triggering frame is an `ert-fail' call, which is not so interesting. But in case of a test throwing an error, this drops the `error' call which is too much. * lisp/emacs-lisp/debug.el (debugger-make-xrefs): Remove. * lisp/emacs-lisp/ert.el (ert--make-xrefs-region): Bring in relevant code from `debugger-make-xrefs'. (ert--print-backtrace): Add DO-XREFS parameter, delegate to `debugger-insert-backtrace'. (ert--run-test-debugger): Record the backtrace frames starting from the instigating `signal' call. (ert-run-tests-batch): Pass nil for `ert--print-backtrace's new DO-XREFS parameter. (ert-results-pop-to-backtrace-for-test-at-point): Pass t as DO-XREFS to `ert--print-backtrace' and remove call to `debugger-make-xrefs'. * test/lisp/emacs-lisp/ert-tests.el (ert-test-record-backtrace): Check the backtrace list instead of comparing its string representation. Expect `signal' to be the first frame.
* Fix wrong indentation after string literal (Bug#27306)Noam Postavsky2017-06-131-0/+13
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (lisp-indent-state) (lisp-indent-calc-next): Remove `depth' field, use (car ppss) instead. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-region-after-string-literal): New test.
* More small authors.el updatesGlenn Morris2017-06-061-1/+1
| | | | | | | | | | * admin/authors.el (authors-aliases): Fix recent addition. (authors-obsolete-files-regexps, authors-no-scan-regexps) (authors-ignored-files, authors-valid-file-names) (authors-renamed-files-alist): Additions. ; * lisp/vc/pcvs.el, test/lisp/emacs-lisp/checkdoc-tests.el: ; Fix Author headers. ; * ChangeLog.2: Fixes.
* cl-print: handle circular objects when `print-circle' is nil (Bug#27117)Noam Postavsky2017-05-311-0/+8
| | | | | | | | * lisp/emacs-lisp/cl-print.el (cl-print--currently-printing): New variable. (cl-print-object): When `print-circle' is nil, bind it to a list of objects that are currently printing to avoid printing the same object endlessly. * test/lisp/emacs-lisp/cl-print-tests.el (cl-print-circle): New test.
* Suppress intermittent test failure on hydraGlenn Morris2017-05-231-0/+2
| | | | | * test/lisp/emacs-lisp/eieio-tests/eieio-tests.el (eieio-test-37-obsolete-name-in-constructor): Skip on hydra.
* Make sure indent-sexp stops at end of sexp (Bug#26878)Noam Postavsky2017-05-151-0/+14
| | | | | | | * lisp/emacs-lisp/lisp-mode.el (indent-sexp): Check endpos before indenting. * test/lisp/emacs-lisp/lisp-mode-tests.el (indent-sexp-stop): New test.
* Merge branch 'fix/bug-21072'Marcin Borkowski2017-05-141-0/+286
|\