summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Some minor Tramp fixes, resulting from test campaignMichael Albinus2020-11-131-4/+11
| | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-handle-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region): * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Use `current-time' if needed. * lisp/net/tramp-gvfs.el (tramp-gvfs-gio-mapping): (tramp-gvfs-do-copy-or-rename-file): Remove "gvfs-rename", it is not trustworthy. * test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p): Check also for symlinked files in trash. (tramp-test20-file-modes): Revert last change, it was a thinko.
* * test/lisp/help-fns-tests.el: Silence byte-compiler.Stefan Kangas2020-11-121-1/+2
|
* * test/lisp/hfy-cmap-resources/rgb.txt: Add comment line.Stefan Kangas2020-11-121-0/+1
|
* Cleanup of the test file for cperl-modeHarald Jörg2020-11-111-182/+152
| | | | | | | | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl--run-test-cases): New macro, factored out from various indentation / rewriting tests. Contains documentation of the format used by the cperl-mode-resources files. (cperl-test-bug-19709): Replace 'next-line' by 'forward-line'. (cperl-test-indent-exp), (cperl-test-indent-styles), (cperl-test-bug-30393): Use the new macro. (cperl-test-bug-19709): Make fit for Emacs 26. (cperl-test-indent-styles): Skip for Perl mode (bug#44561).
* Add test for substitute-command-keys with command remapStefan Kangas2020-11-091-2/+13
| | | | | | | * test/lisp/help-tests.el (help-tests-remap-map): New variable. (help-tests-substitute-command-keys/remap): New test. (help-tests-substitute-command-keys/keymaps) (help-tests-substitute-command-keys/undefined-map): Fix indentation.
* 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.
* cperl-mode: Indentation of ')' follows customisationHarald Jörg2020-11-093-0/+73
| | | | | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-style-alist): Add cperl-close-paren-offset to the settings for PBP style. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug19709): New test to verify correct indentation of closing parentheses (Bug#19709). * test/lisp/progmodes/cperl-mode-resources/cperl-bug-19709.pl: New test case with code from the bug report. * test/lisp/progmodes/cperl-mode-resources/cperl-indent-styles.pl: Add a new test clause for cperl-close-paren-offset.
* Add test for recent change in enable-themeMauro Aranda2020-11-071-0/+9
| | | | | | | * test/lisp/custom-tests.el (custom-test-enable-theme-keeps-settings): Enabling a theme should not change the theme settings, so test for that. See https://lists.gnu.org/archive/html/emacs-devel/2020-11/msg00232.html
* Fix javac message parsing column number off-by-oneMattias Engdegård2020-11-061-2/+2
| | | | | | | | * lisp/progmodes/compile.el (compilation-error-regexp-alist-alist): 'javac': Column numbers are 1-based by default; remove subtraction and η-reduce. Translate regexp to rx (mechanised). * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data): Adapt 'javac' test cases to the change.
* Update gdb-mi-testsMattias Engdegård2020-11-061-2/+4
| | | | | * test/lisp/progmodes/gdb-mi-tests.el (gdb-mi-parse-value): Make test pass after the change in gdb-mi-decode-strings default value.
* ; Silence byte-compiler warnings in testsStefan Kangas2020-11-052-13/+14
| | | | | | * test/lisp/emacs-lisp/easy-mmode-tests.el (easy-mmode--minor-mode): * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393): Silence byte-compiler.
* Still fixes for Tramp directory-files-*Michael Albinus2020-11-051-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp.el (tramp-handle-directory-files): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): Fix COUNT. * lisp/net/tramp-crypt.el (tramp-crypt-handle-directory-files): Implement COUNT. * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-byte-array-to-string): * lisp/net/tramp-integration.el (tramp-eshell-directory-change): Use `nbutlast'. * lisp/net/tramp-rclone.el (tramp-rclone-handle-delete-directory) (tramp-rclone-handle-delete-file): Reorder cache flushing. (tramp-rclone-handle-directory-files): Use `tramp-compat-directory-files'. * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): Fix NOSORT and COUNT. * lisp/net/tramp-smb.el (tramp-smb-handle-directory-files): Fix NOSORT. * test/lisp/net/tramp-tests.el (tramp--test-share-p): New defun. (tramp-test05-expand-file-name-relative): Use it. (tramp-test16-directory-files) (tramp-test19-directory-files-and-attributes): Strengthen test. (tramp-test20-file-modes): Simplify check.
* New gnus-search libraryEric Abrahamsen2020-11-031-0/+96
| | | | | | | | | | | | | | | | | | | | | | | This library provides a fundamental reworking of the search functionality previously found in nnir.el. It uses class-based search engines to interface with external searching facilities, and a parsed search query syntax that can search multiple engines. * lisp/gnus/gnus-search.el: New library containing search functionality for Gnus. * doc/misc/gnus.texi: Document. * lisp/gnus/gnus-group.el (gnus-group-make-search-group, gnus-group-read-ephemeral-search-group): Remove references to nnir, change meaning of prefix argument, change values of nnselect-function and nnselect-args. * lisp/gnus/nnselect.el: Replace references to nnir (nnselect-request-article): Use gnus-search functions, and search criteria. (nnselect-request-thread, nnselect-search-thread): Use gnus-search thread search. (gnus-summary-make-search-group): Switch to use gnus-search function and arguments. * test/lisp/gnus/search-tests.el: Tests for new functionality.
* Some Tramp fixes for directory-files-* and delete-*Michael Albinus2020-11-031-4/+19
| | | | | | | | | | | | | | | | | | | | | | * lisp/files.el (delete-directory): Simplify check for trash. * lisp/net/ange-ftp.el (ange-ftp-delete-file): Implement TRASH. * lisp/net/tramp-compat.el (tramp-compat-directory-files) (tramp-compat-directory-files-and-attributes) (tramp-compat-directory-empty-p): New defaliases. * lisp/net/tramp.el (tramp-handle-directory-files-and-attributes) (tramp-skeleton-delete-directory): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory): Use them. * lisp/net/tramp-sh.el (tramp-sh-handle-directory-files-and-attributes): Implement COUNT. * test/lisp/net/tramp-tests.el (tramp-test14-delete-directory): Do not run trash test for ange-ftp. (tramp-test16-directory-files) (tramp-test19-directory-files-and-attributes): Check COUNT argument.
* cperl-mode: Fix indentation for Emacs 26Harald Jörg2020-11-032-0/+48
| | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-mode): Add a fix which is only required for Emacs versions older than 27. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug30393): Add a test to verify correct indentation (bug#30393).
* cperl-mode: Skip a test for older Emacsen (preparing for ELPA)Harald Jörg2020-11-031-0/+4
| | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Skip this test for older Emacsen. The bug has been fixed in Emacs, but outside of CPerl mode, and therefore will not be available for older versions via ELPA.
* Fix some glitches in recent directory-files-* changesMichael Albinus2020-11-021-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/files.texi (Contents of Directories): Fix description of directory-files, directory-empty-p and directory-files-and-attributes. * etc/NEWS: Fix entry for directory-files-and-attributes. Fix typos. * lisp/dired.el (directory-empty-p): Move function from here ... * lisp/files.el (directory-empty-p): ... to here. * lisp/net/ange-ftp.el (ange-ftp-directory-files): Call `nreverse' later. * lisp/net/tramp.el (tramp-handle-directory-files): * lisp/net/tramp-adb.el (tramp-adb-handle-directory-files-and-attributes): Do not call `nreverse'. * src/dired.c (Fdirectory_files) (Fdirectory_files_and_attributes): Fix docstrings. * test/src/dired-tests.el: Removed. Tests moved to test/lisp/dired-tests.el. * test/lisp/dired-tests.el (dired-test-bug27899): Tag it :unstable. (dired-test-directory-files) (dired-test-directory-files-and-attributes): New tests.
* 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.
* Don't bind standard-output in substitute-command-keysStefan Kangas2020-11-011-0/+20
| | | | | | | | | | | | This fixes a regression with regards to the old C version of substitute-command-keys. * lisp/help.el (substitute-command-keys): Don't bind standard-output. See Bug#39149. * test/lisp/help-tests.el (help-tests--was-in-buffer): New variable. (help-substitute-command-keys/menu-filter-in-correct-buffer): New test.
* 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.
* Trash remote files to local trash (Bug#44216)Michael Albinus2020-11-011-3/+65
| | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (Frequently Asked Questions): Add trashing. * lisp/net/tramp-adb.el (tramp-adb-handle-delete-directory) (tramp-adb-handle-delete-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-directory) (tramp-gvfs-handle-delete-file): * lisp/net/tramp-sh.el (tramp-sh-handle-delete-directory) (tramp-sh-handle-delete-file): * lisp/net/tramp-smb.el (tramp-smb-handle-delete-directory) (tramp-smb-handle-delete-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-delete-directory) (tramp-sudoedit-handle-delete-file): Implement local trash. (Bug#44216) * lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-directory) (tramp-crypt-handle-delete-file): Do not trash. * lisp/net/tramp.el (tramp-skeleton-delete-directory): New defmacro. * test/lisp/net/tramp-tests.el (tramp-test07-file-exists-p) (tramp-test14-delete-directory): Add trashing.
* '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.
* Parse GDB/MI results directly instead of going via JSON (bug#44173)Mattias Engdegård2020-10-311-0/+44
| | | | | | | | | | | | | | | | | | | | | | | Translating GDB/MI into JSON is an unnecessary and fragile detour that made it hard to deal with octal escapes in strings correctly. Parse GDB/MI directly instead. * lisp/progmodes/gdb-mi.el (gdb-mi-decode-strings): Adjust doc string. (gdb-mi-decode, gud-gdbmi-marker-filter): Remove gdb-mi-decode. (gdb-jsonify-buffer): Remove. (gdb-mi--parse-tuple-or-list, gdb-mi--parse-c-string) (gdb-mi--parse-value, gdb-mi--parse-result-or-value) (gdb-mi--parse-results, gdb-mi--fix-key, gdb-mi--extend-fullname) (gdb-mi--c-string-from-string): New functions. (gdb-json-read-buffer, gdb-json-string, gdb-json-partial-output): Rename to gdb-mi--read-buffer, gdb-mi--from-string and gdb-mi--partial-output respectively. Remove useless FIX-LIST argument. FIX-KEY is now a symbol, not a string. All callers updated. (gdb-tooltip-print, gdbmi-bnf-log-stream-output, gdb-internals) (gdb-console, gdb-done-or-error, gdb-get-source-file-list) (gdb-get-prompt, gdb-get-source-file): Use gdb-mi--c-string-from-string instead of 'read'. * test/lisp/progmodes/gdb-mi-tests.el: New file.
* Fix unit tests broken by changes to xt-mouse.elJared Finder2020-10-311-4/+4
| | | | | * test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic) (xt-mouse-tracking-utf-8): Update expected escape sequence.
* Revert "Temporarily mark two failing tests"Eli Zaretskii2020-10-311-2/+0
| | | | | This reverts commit a8426f46726d94cdf21c0e6b3c85c0afe0064784. A proper fix for the test is about to be installed shortly.
* * lisp/simple.el (blink-matching-open): Fix bug#37127Stefan Monnier2020-10-301-16/+23
| | | | | | | | | | | Don't call `syntax-propertize` from within narrowing * lisp/progmodes/cperl-mode.el (cperl-forward-re): Revert last patch, since it is now redundant. * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Remove unused var; fix test so it really catches the previous bug; tweak the code to use mode-agnostic commands so it also works in `perl-mode`.
* Revert "Adjust python tests after fix for bug#39398"Lars Ingebrigtsen2020-10-301-3/+3
| | | | | | This reverts commit c6fb23873a594b6a4fc57fa107869a2e82159d07. The code is tweaked to be more backwards-compatible.
* ; 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.
* Suppress a misleading message when closing a paren in a regexHarald Jörg2020-10-301-0/+29
| | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-forward-re): Suppress an error message about "End of string/RE not found" when we are at the end of a narrowed buffer where the end of a RE is temporarily unavailable (Bug#37127). * test/lisp/progmodes/cperl-mode-tests.el (cperl-bug37127): Add a test to verify that the message is suppressed when inappropriate, but appears when the RE *is* incomplete.
* 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.
* `format-time' can now do sub-second timesLars Ingebrigtsen2020-10-301-1/+8
| | | | | | | * doc/lispref/os.texi (Time Parsing): Document it. * lisp/calendar/time-date.el (format-seconds): Allow formatting sub-second times.
* * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Expand test.Hugh Daschbach2020-10-301-51/+79
|
* cperl-mode: Make timeout test more robustHarald Jörg2020-10-291-1/+3
| | | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl-mode-test-bug-10483): Increase the timeout to 2 seconds and mark the test as expensive. Also, suppress it for Emacs versions below 28, where the test times out though the function works in manual tests. (Bug#44317)
* Handle several children of PATH in dbus-managed-objects-handlerMichael Albinus2020-10-291-10/+5
| | | | | | | | | | * lisp/net/dbus.el (dbus-managed-objects-handler): Handle several children of PATH. (Bug#44298) * src/dbusbind.c (xd_signature, xd_append_arg): Check object path. * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): Tag it :expensive-test. Remove superfluous check.
* * test/lisp/net/dbus-tests.el (dbus-test09-get-managed-objects): New test.Hugh Daschbach2020-10-291-0/+82
|
* Disable mml-sec-tests on MacOSLars Ingebrigtsen2020-10-281-1/+4
| | | | | * test/lisp/gnus/mml-sec-tests.el (test-conf): Disable tests on MacOS (bug#44259).
* Adjust python tests after fix for bug#39398Lars Ingebrigtsen2020-10-281-3/+3
|
* ; Fix license statement in several filesStefan Kangas2020-10-2811-33/+55
| | | | Add the line "This file is part of GNU Emacs."
* Use lexical-binding in netrc.el and add testsStefan Kangas2020-10-283-0/+61
| | | | | | | | * lisp/net/netrc.el: Use lexical-binding. (netrc-file): Remove redundant :group arg. * test/lisp/net/netrc-resources/authinfo: * test/lisp/net/netrc-resources/services: * test/lisp/net/netrc-tests.el: New files.
* Temporarily mark two failing testsGlenn Morris2020-10-271-0/+2
| | | | | | | | ; Persistently failing tests can cause problems for automated builds, ; and make it harder to spot new failures. * test/lisp/xt-mouse-tests.el (xt-mouse-tracking-basic) (xt-mouse-tracking-utf-8): Currently failing.
* Fix sunrise and sunset calculation (bug#44237)Mattias Engdegård2020-10-271-0/+42
| | | | | | | * lisp/calendar/solar.el (solar-moment): Use initial values for binary search that won't end the loop prematurely and yield incorrect answers. * test/lisp/calendar/solar-tests.el: New file.
* Don't rely on bignums in ntlm.elMattias Engdegård2020-10-271-0/+52
| | | | | | | | | | | | | | | | Since ntlm.el is distributed as a separate package in GNU ELPA and should be able to run on older Emacs versions without bignums, we cannot make use of them here. See discussion at https://lists.gnu.org/archive/html/emacs-devel/2020-10/msg01665.html. Instead, we add a small poor man's bignum implementation. * lisp/net/ntlm.el (ntlm--bignat-of-int, ntlm--bignat-add) (ntlm--bignat-shift-left, ntlm--bignat-mul-byte, ntlm--bignat-mul) (ntlm--bignat-of-string, ntlm--bignat-of-digits) (ntlm--bignat-to-int64): New. (ntlm--time-to-timestamp): Use the ntlm--bignat- functions instead of Lisp integers. * test/lisp/net/ntlm-tests.el: New file.
* Fix time-test error on machines with mailLars Ingebrigtsen2020-10-261-0/+1
| | | | | * test/lisp/time-tests.el (time-tests-display-time-update): There may be mail on the machine (bug#44241).
* 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.
* Revert commit 1f44a776729adf9c6468a76f8310616fde62eeaa for XRef.Philipp Stephani2020-10-251-2/+4
| | | | | | | | XRef supports Emacs versions back to Emacs 26.3, so it can’t use newer functions such as ‘ert-resource-directory’. * test/lisp/progmodes/xref-tests.el (xref-tests-data-dir): Don’t use ‘ert-resource-directory’
* Revert commit 1f44a776729adf9c6468a76f8310616fde62eeaa for Flymake.Philipp Stephani2020-10-251-2/+9
| | | | | | | | | Flymake supports all Emacs versions back to 26.1, so it can’t use ‘ert-resource-file’. * test/lisp/progmodes/flymake-tests.el (flymake-tests-data-directory): Recreate. (flymake-tests--call-with-fixture): Stop using ‘ert-resource-file’.
* ; Prefer https to http in more URLsStefan Kangas2020-10-247-8/+8
| | | | These were all tested and confirmed working.
* Accept nil COMMAND in tramp-sh-handle-make-process (Bug#44151)Michael Albinus2020-10-241-0/+16
| | | | | | | | * lisp/net/tramp-sh.el (tramp-sh-handle-make-process): Accept nil COMMAND. (Bug#44151) * test/lisp/net/tramp-tests.el (tramp-test29-start-file-process): Extend test.