summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
Commit message (Collapse)AuthorAgeFilesLines
* Test for byte-compiler warning "variable lacks prefix"Stefan Kangas2020-11-221-10/+16
| | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test): New macro. (bytecomp-warn-wrong-args, bytecomp-warn-wrong-args-subr): Use above new macro. (bytecomp-warn-variable-lacks-prefix): New test.
* Test interactive-only spec of with-suppressed-warningsStefan Kangas2020-11-221-0/+6
| | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-test--with-suppressed-warnings): Test suppressing warning with interactive-only.
* Better warning suppression in rx-testsMattias Engdegård2020-11-091-1/+1
| | | | | | * test/lisp/emacs-lisp/rx-tests.el (rx-compat): Use with-no-warnings instead of with-suppressed-warnings which complains when running the test interactively.
* Fix pcase rx form snag with '?' and '??' (bug#44532)Mattias Engdegård2020-11-091-1/+5
| | | | | | | | This is a regression from Emacs 26. Reported by Phillip Stephani. * lisp/emacs-lisp/rx.el (rx--pcase-transform): Process ? and ?? correctly. * test/lisp/emacs-lisp/rx-tests.el (rx-pcase): Add test case.
* ; Silence byte-compiler warnings in testsStefan Kangas2020-11-051-12/+13
| | | | | | * test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--minor-mode): * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393): Silence byte-compiler.
* Partially revert previous define-minor-mode changeLars Ingebrigtsen2020-11-021-8/+2
| | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Only document the values we want to support, not the ones we actually support. (define-minor-mode): Partially revert to previous behaviour.
* Make minor mode ARG work as documentedLars Ingebrigtsen2020-11-011-0/+21
| | | | | | | | * lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Clarify when minor modes are switched on/off when called from lisp (bug#44341). (define-minor-mode): Make calls from Lisp switch the mode on/off as documented.
* 'assoc' is not side-effect-free; constprop its pure subsetMattias Engdegård2020-10-311-1/+6
| | | | | | | | | | | Since a supplied test function can do anything, assoc is not side-effect-free (bug#44018). However, with only two arguments it is pure and should be optimised accordingly. * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Remove 'assoc'. (byte-optimize-assoc): Constant-propagate through 2-arg assoc calls. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Add test cases.
* Trim and explain set of safe forms for 'unsafep' (bug#44018)Mattias Engdegård2020-10-311-0/+12
| | | | | | | | | | | | | | | * lisp/emacs-lisp/unsafep.el: Add comment explaining the policy for which forms can be considered 'safe' in the sense of unsafep. Remove ones that didn't make the cut: play-sound-file (large attack surface) catch, throw (alter program flow, inject data) replace-regexp-in-string (execute arbitary code) error, signal (deceptive messages) * test/lisp/emacs-lisp/unsafep-tests.el (unsafep-tests--unsafe): Add test cases. * etc/NEWS: Announce the change.
* ; Fix typo in my last commitStefan Kangas2020-10-301-1/+1
| | | | | * test/lisp/emacs-lisp/text-property-search-tests.el (text-property-search--pos-test): Fix typo.
* Clarify point position after text-property-searchStefan Kangas2020-10-301-0/+18
| | | | | | | | | | * lisp/emacs-lisp/text-property-search.el (text-property-search-forward, text-property-search-backward): Doc fix to clarify placement of point after search. * test/lisp/emacs-lisp/text-property-search-tests.el (text-property-search--pos-test): New defun. (text-property-search-forward-point-at-beginning) (text-property-search-backward-point-at-end): New test.
* ; Fix license statement in several filesStefan Kangas2020-10-281-3/+5
| | | | Add the line "This file is part of GNU Emacs."
* Implement a :predicate parameter for globalized minor modesLars Ingebrigtsen2020-10-261-0/+49
| | | | | | | | | * doc/lispref/modes.texi (Defining Minor Modes): Describe the new :predicate keyword (bug#44232). * lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Allow a new :predicate keyword. (easy-mmode--globalized-predicate-p): New function.
* Use lexical-binding in copyright.el and add testsStefan Kangas2020-10-241-0/+50
| | | | | | * lisp/emacs-lisp/copyright.el: Use lexical-binding. Remove redundant :group args. * test/lisp/emacs-lisp/copyright-tests.el: New file.
* Fix a broken unsafep testStefan Kangas2020-10-241-12/+10
| | | | | | | | | | * test/lisp/emacs-lisp/unsafep-tests.el (test-unsafep/message): Fix test case. (unsafep-tests--safe): Rename from testcover-unsafep-safe. (unsafep-tests--unsafe): Rename from testcover-unsafep-unsafe. (test-unsafep/safe, test-unsafep/unsafe): Doc fix. Adjust usage of above renamed variables.
* Clean up temporary files after package testsStefan Kangas2020-10-231-0/+9
| | | | | * test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove temporary files after test. (Bug#43359)
* Remove incorrect use of decode-coding-stringStefan Kangas2020-10-221-2/+2
| | | | | | | | * test/lisp/emacs-lisp/bindat-tests.el (bindat-test-pack/multibyte-string-fails) (bindat-test-unpack/multibyte-string-fails): Don't use decode-coding-string. Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
* Test for error with multibyte strings in bindat.elStefan Kangas2020-10-221-2/+8
| | | | | | * test/lisp/emacs-lisp/bindat-tests.el (bindat-test-pack/multibyte-string-fails) (bindat-test-unpack/multibyte-string-fails): New tests.
* byte-compile-file: Make optional LOAD argument obsoleteStefan Kangas2020-10-201-3/+4
| | | | | | | | | * lisp/emacs-lisp/bytecomp.el (byte-compile-file): Declare optional LOAD argument obsolete. Adjust callers. (Bug#38072) (byte-recompile-file): Declare optional LOAD argument obsolete. * doc/lispref/compile.texi (Compilation Functions): Update documentation to reflect above obsoletion. * etc/NEWS: Announce above obsoletion.
* Tweak test data for signed package installationStefan Kangas2020-10-207-47/+83
| | | | | | | | | | | | | * test/lisp/emacs-lisp/package-resources/signed/signed-bad-1.0.el: * test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el: Use lexical-binding. * test/lisp/emacs-lisp/package-resources/signed/update-signatures.sh: New file. * test/lisp/emacs-lisp/package-resources/key.pub: * test/lisp/emacs-lisp/package-resources/key.sec: Add new key. * test/lisp/emacs-lisp/package-resources/signed/signed-good-1.0.el.sig: * test/lisp/emacs-lisp/package-resources/signed/archive-contents.sig: Update signatures using new key.
* Fix file-name problems in several testsEli Zaretskii2020-10-162-2/+6
| | | | | | | | | | | | | | * test/lisp/saveplace-tests.el (saveplace-test-forget-unreadable-files): Use file-truename, to avoid false negatives when file names are not 'equal' as strings, but point to the same file. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-with-normal-env) (edebug-tests-run-macro): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-markup-region, testcover-tests-run-test-case): Bind find-file-suppress-same-file-warnings to a non-nil value, to avoid warnings about "same-file-names", at least on MS-Windows, due to 8+3 aliases.
* Use new resource directory macros in tests (Bug#43792)Stefan Kangas2020-10-164-66/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/bookmark-tests.el (bookmark-tests-data-dir): * test/lisp/calendar/todo-mode-tests.el (todo-test-data-dir): * test/lisp/net/dbus-tests.el (dbus--tests-dir): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-sample-code-file): * test/lisp/emacs-lisp/package-tests.el (package-test-fake-contents-file): * test/lisp/emacs-lisp/shadow-tests.el (shadow-tests-data-directory): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-file-dir, testcover-tests-test-cases): * test/lisp/mail/uudecode-tests.el (uudecode-tests-data-dir): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-resource-directory): * test/lisp/pcmpl-linux-tests.el (pcmpl-linux-tests-data-dir): * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-tests-data-directory): * test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory): * test/lisp/progmodes/ruby-mode-tests.el (ruby-mode-tests-data-dir): * test/lisp/saveplace-tests.el (saveplace-tests-dir): * test/lisp/textmodes/css-mode-tests.el (css-mode-tests-data-dir): Remove. * test/lisp/bookmark-tests.el (bookmark-tests-bookmark-file) (bookmark-tests-example-file, bookmark-tests-bookmark-file-list): * test/lisp/calendar/todo-mode-tests.el (todo-test-file-1) (todo-test-archive-1, with-todo-test, todo-test--add-file): * test/lisp/custom-tests.el (custom--test-theme-variables): * test/lisp/net/dbus-tests.el (dbus--test-introspect): * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-setup-code-file): * test/lisp/emacs-lisp/package-tests.el (package-test-data-dir) (package-test-desc-from-buffer, package-test-install-single) (package-test-macro-compilation) (package-test-install-prioritized) (package-test-install-multifile, package-test-update-archives) (package-test-update-archives-async) (package-test-update-archives/ignore-nil-entry) (package-test-signed, package-x-test-upload-buffer) (package-x-test-upload-new-version): * test/lisp/emacs-lisp/shadow-tests.el (shadow-case-insensitive): * test/lisp/emacs-lisp/testcover-tests.el (testcover-tests-build-test-cases): * test/lisp/mail/uudecode-tests.el (uudecode-tests-encoded-str) (uudecode-tests-decoded-str): * test/lisp/net/tramp-archive-tests.el (tramp-archive-test-file-archive) (tramp-archive-test-directory): * test/lisp/pcmpl-linux-tests.el (pcmpl-linux-test-fs-types) (pcmpl-linux-test-mounted-directories): * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-10483) (cperl-mode-test-indent-styles): * test/lisp/progmodes/flymake-tests.el (flymake-tests--call-with-fixture): * test/lisp/progmodes/ruby-mode-tests.el (ruby--indent/converted-from-manual-test): * test/lisp/saveplace-tests.el (saveplace-test-save-place-to-alist/dir) (saveplace-test-load-alist-from-file): * test/lisp/textmodes/css-mode-tests.el (css-mode-test-indent): Adjust to use new resource directory macros.
* Adjust some tests so that they work in symlinked environsStephen Berman2020-10-161-1/+1
| | | | | | | | | | * test/lisp/help-fns-tests.el (help-fns-test-lisp-macro) (help-fns-test-lisp-defsubst): * test/lisp/emacs-lisp/cl-generic-tests.el (cl-generic-tests--method-files--finds-methods): Adjust test so that they work in a symlinked environment (bug#43004). (cl-generic-tests--method-files--finds-methods): Use file-truename so that this works in a symlinked environment (bug#43004).
* Suppress obsoletion warning in test of obsolete rx functionMattias Engdegård2020-10-061-1/+4
| | | | | * test/lisp/emacs-lisp/rx-tests.el (rx-compat): Add byte-compilation warning suppression.
* Merge from origin/emacs-27Glenn Morris2020-10-022-2/+2
|\ | | | | | | | | | | | | | | | | 78eacf31e8 ; Fix many typos in symbols in docs and comments d5d12707d6 * doc/misc/flymake.texi (Using Flymake): Fix a typo. (Bug... # Conflicts: # lisp/allout.el # lisp/progmodes/ebrowse.el
| * ; Fix many typos in symbols in docs and commentsStefan Kangas2020-10-022-2/+2
| |
* | Update a failing lisp testGlenn Morris2020-09-241-1/+1
| | | | | | | | | | * test/lisp/emacs-lisp/lisp-tests.el (up-list-no-cross-string): Update for recent "Don't signal scan-error" change.
* | Make delete-pair only delete pairs that are part of insert-pair-alistmartin rudalics2020-09-221-2/+1
| | | | | | | | | | * lisp/emacs-lisp/lisp.el (delete-pair): Only delete pairs that are part of `insert-pair-alist' (bug#4136).
* | Remove some unnecessary compat codeStefan Kangas2020-09-221-12/+9
| | | | | | | | | | | | | | * test/lisp/emacs-lisp/ert-x-tests.el (ert-test-describe-test): * test/lisp/wdired-tests.el (wdired-test-unfinished-edit-01): Remove unnecessary compat code; these tests should never need to run on older versions of Emacs.
* | Convert manual indent test for lisp-mode into unit testStefan Kangas2020-09-211-0/+12
| | | | | | | | | | | | * test/manual/indent/lisp.lisp: Delete file. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-indent-defun): New unit test based on deleted file.
* | ; Fix more trivial typosStefan Kangas2020-09-211-1/+1
| |
* | ; Fix typosStefan Kangas2020-09-212-2/+2
| |
* | * test/lisp/emacs-lisp/find-func-tests.el: New file (for bug#43393)Stefan Monnier2020-09-141-0/+45
| | | | | | | | | | | | | | | | * lisp/emacs-lisp/ert-x.el (ert-simulate-keys): New macro. * test/lisp/international/mule-tests.el (mule-cmds--test-universal-coding-system-argument): Use it and enable the test also in batch mode.
* | Adapt some tests for Emacs's excitingly variable quoting formatGlenn Morris2020-09-121-2/+3
| | | | | | | | | | | | | | | | * test/lisp/subr-tests.el (subr-test-version-parsing): * test/lisp/emacs-lisp/gv-tests.el (gv-dont-define-expander-other-file): * test/src/callint-tests.el (call-interactively/incomplete-multibyte-sequence): * test/src/emacs-module-tests.el (module/describe-function-1): Don't fail if curly quotes are in use, as they can be if LC_ALL != C.
* | Mark some tests as expensiveStefan Kangas2020-09-102-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/autorevert-tests.el (auto-revert-test00-auto-revert-mode) (auto-revert-test03-auto-revert-tail-mode) (auto-revert-test04-auto-revert-mode-dired): * test/lisp/cedet/semantic-utest-c.el (semantic-test-c-preprocessor-simulation): * test/lisp/cedet/srecode-utest-getset.el (srecode-utest-getset-output): * test/lisp/emacs-lisp/cl-seq-tests.el (cl-seq-test-bug24264): * test/lisp/emacs-lisp/package-tests.el (package-test-update-archives-async): * test/lisp/filenotify-tests.el (file-notify-test03-events) (file-notify-test04-autorevert) (file-notify-test05-file-validity, file-notify-test08-backup): * test/lisp/net/gnutls-tests.el (test-gnutls-005-aead-ciphers): * test/lisp/shadowfile-tests.el (shadow-test00-clusters) (shadow-test09-shadow-copy-files):
* | Add gv-define-expander for plist-getNaoya Yamashita2020-09-091-0/+40
| | | | | | | | | | | | | | | | | | | | It is necessary to make plist-get as a generalized variable, and this definition allows user to use setf and other useful functions on plist-get. * lisp/emacs-lisp/gv.el: Add gv-define-expander for plist-get * lisp/emacs-lisp/gv-tests.el: Add new tests for plist-get
* | ; Fix typosStefan Kangas2020-09-071-2/+2
| |
* | Convert unsafep tests to ertStefan Kangas2020-08-291-0/+144
| | | | | | | | | | | | * lisp/emacs-lisp/tcover-unsafep.el: Move from here... * test/lisp/emacs-lisp/unsafep-tests.el: ...to here, and convert to use ert instead of tcover.
* | Use lexical-binding in more testsStefan Kangas2020-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lib-src/emacsclient-tests.el: * test/lisp/emacs-lisp/hierarchy-tests.el: * test/lisp/eshell/eshell-tests.el: * test/lisp/gnus/gnus-util-tests.el: * test/lisp/progmodes/js-tests.el: * test/lisp/textmodes/bibtex-tests.el: * test/src/editfns-tests.el: * test/src/fns-tests.el: Use lexical-binding. * test/lisp/emacs-lisp/hierarchy-tests.el (hierarchy-leafs-includes-lonely-roots): * test/src/editfns-tests.el (transpose-test-get-byte-positions): * test/src/fns-tests.el (fns-tests-func-arity): Adjust for lexical-binding.
* | * test/lisp/emacs-lisp/rx-tests.el: Improve test coverage.Mattias Engdegård2020-08-291-4/+9
| |
* | Use lexical-binding in warnings.el and add testsStefan Kangas2020-08-281-0/+60
| | | | | | | | | | | | | | * lisp/warnings.el: Use lexical-binding. Remove redundant :group args. * test/lisp/warnings-tests.el: New file.
* | ; Fix license statements.Stefan Kangas2020-08-273-9/+15
| |
* | Merge from origin/emacs-27Michael Albinus2020-08-251-4/+12
|\| | | | | | | | | | | | | | | | | | | 44104a607a Fix error in GMP test e26e63444d Add Feature testing for Windows binaries 4e2caef384 ; * src/character.c (str_as_multibyte): Fix the commentary. d3a4ce8420 Revert "; * etc/NEWS: Remove temporary note on documentati... 16f00e36dc * admin/admin.el (set-version): Trap yet another NEWS error. 121be3e118 ; * etc/NEWS: Remove temporary note on documentation. (Bu... 5fcb97dabd Fix cond jump table compilation (bug#42919)
| * Fix cond jump table compilation (bug#42919)Mattias Engdegård2020-08-191-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bug affected compilation of (cond ((member '(some list) variable) ...) ...) While equal is symmetric, member is not; in the latter case the arguments must be a variable and a constant list, in that order. Reported by Ikumi Keita. * lisp/emacs-lisp/bytecomp.el (byte-compile--cond-switch-prefix): Don't treat equality and member predicates in the same way; only the former are symmetric in their arguments. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Add test cases.
* | ; Minor simplification of two recent changesBasil L. Contovounesios2020-08-191-2/+1
| |
* | Distinguish errors in bytecomp-testsMattias Engdegård2020-08-191-21/+21
| | | | | | | | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-check-1) (test-byte-opt-arithmetic, bytecomp-lexbind-check-1) (bytecomp-lexbind-explain-1): When comparing interpreted with compiled results, don't consider all errors to be equal; take the error type into account. (The error arguments may differ, but there may be good reasons for that.)
* | Make bytecomp-tests re-runnableMattias Engdegård2020-08-191-0/+2
| | | | | | | | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (test-byte-comp-macro-expand-lexical-override): Remove functions before testing so that the test can be run twice without failing.
* | Add tests for cl-{incf,decf}Stefan Kangas2020-08-131-0/+16
| | | | | | | | | | * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-incf) (cl-lib-test-decf): New tests.
* | Fix (end-of-defun N) for N >= 2Noam Postavsky2020-08-111-0/+55
| | | | | | | | | | | | | | * lisp/emacs-lisp/lisp.el (end-of-defun): Only skip to next line when after end of defun when ARG is 1 or less. * test/lisp/emacs-lisp/lisp-tests.el (end-of-defun-twice): New test (bug#24427).
* | Add the new library hierarchy.elDamien Cassou2020-08-091-0/+556
| | | | | | | | * lisp/emacs-lisp/hierarchy.el: New file.