summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Clean up temp files after some testsGlenn Morris2017-08-142-13/+18
| | | | | | | * 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.
* Add test suites for arc-mode and tar-modeTino Calancha2017-08-132-0/+72
| | | | | | * test/lisp/arc-mode-tests.el (arc-mode-test-archive-int-to-mode) * test/lisp/tar-mode-tests.el (tar-mode-test-tar-grind-file-mode): New tests.
* Fix make-temp-file bug with ""/"."/".." prefixPaul Eggert2017-08-121-0/+14
| | | | | | | | | | | | | | | | | The bug with "." and ".." has been present for a while; I introduced the bug with "" earlier today in my patch for Bug#28023. * lisp/files.el (make-temp-file): Do not use expand-file-name if PREFIX is empty or "." or "..", as it does the wrong thing. Compute absolute-prefix here ... (files--make-magic-temp-file): ... instead of here ... * src/fileio.c (Fmake_temp_file_internal): ... or here. * lisp/files.el (make-temp-file): If the prefix is empty, append "/" to the absolute prefix so that the new files are children rather than siblings of temporary-file-directory. This fixes a bug introduced in the previous change. * test/lisp/files-tests.el (files-test-make-temp-file-empty-prefix): New test, for the bug.
* Implement EXCL of write-region for TrampMichael Albinus2017-08-121-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/ange-ftp.el (ange-ftp-write-region): * lisp/net/tramp-adb.el (tramp-adb-handle-write-region) * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-write-region): * lisp/net/tramp-sh.el (tramp-sh-handle-write-region) * lisp/net/tramp-smb.el (tramp-smb-handle-write-region): Implement MUSTBENEW. * lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file) * lisp/net/tramp-sh.el (tramp-sh-handle-make-symbolic-link) (tramp-sh-handle-add-name-to-file) (tramp-do-copy-or-rename-file) * lisp/net/tramp-smb.el (tramp-smb-handle-make-symbolic-link): Adapt error message for `file-already-exists'. * src/lisp.h: * src/eval.c (call8): New function. * src/fileio.c (write_region): Pass also lockname and mustbenew to the file name handler. * test/lisp/net/tramp-tests.el (tramp-test10-write-region): Add tests for MUSTBENEW.
* Fix a minor todo-mode regressionStephen Berman2017-08-111-9/+41
| | | | | | | | | | | | | | | | | | * lisp/calendar/todo-mode.el (todo-get-overlay): Wrap in save-excursion. This fixes a regression introduced by the fix for bug#27609, whereby trying to raise the priority of the first item or lower the priority of the last item, which should be noops, moves point to the item's start. Clarify comment. * test/lisp/calendar/todo-mode-tests.el (todo-test-raise-lower-priority): Add test cases for trying to raise first item and lower last item. (with-todo-test): Clear abbreviated-home-dir, since we change HOME. (todo-test-toggle-item-header02): Remove ":expected-result :failed" and tests of point after todo-next-item, since the effect when using Todo mode is not reproducible in the test environment. Add commentary about this.
* Respect buffer-local value of tags-table-list (Bug#27772)Noam Postavsky2017-08-101-6/+25
| | | | | | | | | | | | * lisp/progmodes/etags.el (visit-tags-table-buffer): Save the current buffer around the `tags-table-including' calls so as to get buffer local variables from the right buffer later. * test/lisp/progmodes/etags-tests.el (etags-visit-tags-table-buffer): New test. * test/lisp/progmodes/etags-tests.el (etags-tests--test-dir): New constant. (etags-bug-158, etags-bug-23164): Use it so that when running the test interactively, setting EMACS_TEST_DIRECTORY is not needed.
* dired-delete-file: Dont't ask for empty dirsTino Calancha2017-08-091-0/+85
| | | | | | | | | * lisp/dired.el (dired--yes-no-all-quit-help): New defun. (dired-delete-file): Use it. Dont't ask for empty dirs (Bug#27940). * test/lisp/dired-tests.el (dired-test-with-temp-dirs): New auxiliar macro. (dired-test-bug27940): Add new test.
* query-replace: Undo replacements performed with 'commaTino Calancha2017-08-081-0/+22
| | | | | | | | | | During a `query-replace', the char ',' replaces the character at point and doesn't move point; right after, the char 'u' must undo such replacement (Bug#27268). * lisp/replace.el (replace--push-stack): New macro extracted from `perform-replace'. (perform-replace): Use it. * test/lisp/replace-tests.el (query-replace--undo): Add test.
* 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-073-1/+24
| | | | | | | | * 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.
* Minor tweak in a dired testTino Calancha2017-08-061-2/+6
| | | | | * test/lisp/dired-tests.el (dired-test-bug27968): Ensure the new header has different length than the original one.
* Dired w/ eshell-ls: Handle shell wildcards in file nameTino Calancha2017-08-061-0/+18
| | | | | | * lisp/eshell/em-ls.el (eshell-ls--insert-directory): Use eshell-extended-glob (Bug#27844). * test/lisp/dired-tests.el (dired-test-bug27844): Add test.
* dired-revert: save line numbers instead of positionsTino Calancha2017-08-061-0/+46
| | | | | | | | | | | | Positions might change if the length of one dired header line changes; this happen, for instance, if we add new files. Instead, line numbers are invariant under shrinks/enlargements of the file header. https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01092.html * lisp/dired.el (dired-save-positions): Save the line numbers at point. (dired-restore-positions): Use forward-line to restore the original position (Bug#27968). * test/lisp/dired-tests.el (dired-test-bug27968): Add test.
* Fix files-tests.el for MS-WindowsEli Zaretskii2017-08-051-4/+5
| | | | | | * test/lisp/files-tests.el (files-tests--file-name-non-special--subprocess): Fix this test for MS-Windows.
* insert-directory-wildcard-in-dir-p: Tweak regexpTino Calancha2017-08-051-0/+18
| | | | | | | This function must return non-nil for a wildcard like '/*/*.txt'. * lisp/files.el (insert-directory-wildcard-in-dir-p): Adjust regexp. * test/lisp/files-tests.el (files-tests--insert-directory-wildcard-in-dir-p): Add test.
* ; 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.
* Fix dired-test-bug27631 on MS-WindowsTino Calancha2017-08-041-0/+4
| | | | | | | | Skip the test if Dired use 'ls' emulation with lisp. The same bug is tested in their respective test suites: ls-lisp-tests.el and em-ls-tests.el. * test/lisp/dired-tests.el (dired-test-bug27631): Skip test if 'ls-lisp' or 'eshell' features are enabled.
* Fix dired-test-bug25609 on MS-WindowsEli Zaretskii2017-08-041-0/+9
| | | | | | * test/lisp/dired-tests.el (dired-test-bug25609): On MS-Windows, pass temporary files through file-truename, to avoid bogus failures due to file-name comparison as strings.
* Fix 2 tests that fail in MS-WindowsTino Calancha2017-08-042-24/+49
| | | | | | | | | | | | | | | https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00018.html * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084): Add comments to explain the test logic. Pass '--binary' option to 'patch' program in windows environments. Check explicitely that a backup is created before compare file contents. * test/lisp/dired-tests.el (dired-test-bug25609): Declare variable 'dired-dwim-target' right before the test. Add comments to explain the test logic. Ensure, before test the bug condition, that we are displaying the 2 dired buffers created in this test, and no other dired buffer is shown.
* Add debugging messages to a Dired testStephen Berman2017-08-021-2/+10
| | | | | | * test/lisp/dired-tests.el (dired-test-bug27243-01): Log positions saved and restored by dired-revert to try and find out why the test fails on Hydra.
* ; Extend traces in tramp-test36-asynchronous-requests for hydraMichael Albinus2017-08-021-5/+5
|
* dired-align-file: Inherit text properties in inserted spacesTino Calancha2017-08-021-0/+15
| | | | | | * lisp/dired.el (dired-align-file): Inherit text properties in inserted spaces (Bug#27899). * test/lisp/dired-tests.el (dired-test-bug27899): Add test.
* Move dired tests using ls emulation to different filesTino Calancha2017-08-023-92/+140
| | | | | | | | | | | | | | | | | Suggested in: https://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00018.html * test/lisp/dired-tests.el (dired-test-bug27693) (dired-test-bug27762, dired-test-bug27817) (dired-test-bug27631, dired-test-bug27843): Delete those parts requiring either ls-lisp or eshell-ls. * test/lisp/ls-lisp-tests.el (ls-lisp-test-bug27762) (ls-lisp-test-bug27631, ls-lisp-test-bug27693): Add all dired tests using ls-lisp here. * test/lisp/eshell/em-ls-tests.el (em-ls-test-bug27631) (em-ls-test-bug27817, em-ls-test-bug27843): New test file. Add all dired tests using eshell-ls here.
* * test/lisp/ls-lisp-tests.el: Rename it from ls-lisp.elTino Calancha2017-08-021-0/+0
|
* Fix misalignment in Dired when dired-directory is a consTino Calancha2017-08-021-1/+0
| | | | | | | | * lisp/dired.el (dired--need-align-p, dired--align-all-files): New defuns. (dired-internal-noselect): Call dired--align-all-files when dired-directory is a cons (Bug#27762). * test/lisp/dired-tests.el (dired-test-bug27762): Test should pass.
* Fix some dired-tests.el on MS-WindowsEli Zaretskii2017-08-011-0/+10
| | | | | | | * test/lisp/dired-tests.el (dired-test-bug27243-01) (dired-test-bug27243-02): On MS-Windows, pass test-dir through file-truename, to avoid bogus failures due to file-name comparison as strings.
* Insert subdir content if dir-or-list is a string w/o wildcardsTino Calancha2017-08-011-0/+15
| | | | | | | * lisp/eshell/em-ls.el (eshell-ls--insert-directory): Append '("-d") into 'eshell-ls-dired-initial-args' if 'dired-directory' is a cons or there are wildcars (Bug#27843). * test/lisp/dired-tests.el (dired-test-bug27843): Add test.
* Add more should form calls in a failing dired testTino Calancha2017-08-011-4/+10
| | | | | | | | | Some dired tests fail intermittently in hydra. Add few more should form calls for debugging. See: https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01092.html * test/lisp/dired-tests.el (dired-test-bug27243-01): Add few more should forms for debugging.
* dired-tests: Unload tested features after test themTino Calancha2017-07-311-1/+6
| | | | | | | | | | | | Some tests are for Dired with ls-lisp or eshell-ls. Requiring these features add an advice on `dired' and might affect other tests. Do not require these features at the top of the file; require then inside the tests and unload then at the end. * test/lisp/dired-tests.el (dired-test-bug27693) (dired-test-bug7131, dired-test-bug27817, dired-test-bug27631): require ls-lisp and/or eshell-ls inside the test; unload the features at the end.
* Small adaptions for directory wildcardsMichael Albinus2017-07-311-5/+10
| | | | | | | | | | * lisp/dired.el (dired-insert-directory): Remove "--dired" when there are wildcards, and the directory is remote. * test/lisp/net/tramp-tests.el (tramp--test-make-temp-name): Adapt docstring. (tramp-test17-dired-with-wildcards): Skip for all methods but those from tamp-sh.p.
* ; Change instrumentation code in tramp-tests.elMichael Albinus2017-07-311-13/+4
|
* * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards): New test.Michael Albinus2017-07-301-1/+103
|
* Dired: Handle posix wildcards in directory partTino Calancha2017-07-301-0/+38
| | | | | | | | | | | | | | | | | | | | | | Allow Dired to handle calls like \(dired \"~/foo/*/*.el\"), that is, with wildcards within the directory part of the file argument (Bug#27631). * lisp/files.el (insert-directory-wildcard-in-dir-p): New predicate. (insert-directory-clean): New defun extracted from insert-directory. (insert-directory) * lisp/dired.el (dired-internal-noselect) (dired-insert-directory): Use the new predicate; when it's true, handle the directory wildcards with a shell call. * lisp/eshell/em-ls.el (eshell-ls-use-in-dired): Add/remove both advices. (eshell-ls-unload-hook): New defun. Use it in eshell-ls-unload-hook instead of an anonymous function. (eshell-ls--dired) * lisp/ls-lisp.el (ls-lisp--dired): Advice dired to handle wildcards in the directory part with both eshell-ls and ls-lisp. * etc/NEWS: Announce it. * doc/emacs/dired.texi (Dired Enter): Update manual. * test/lisp/dired-tests.el (dired-test-bug27631): Add test.
* Preserve point under 'dired-auto-revert-buffer' (third case)Stephen Berman2017-07-291-5/+94
| | | | | | | | | | | | | | | * lisp/files.el (find-file): Use pop-to-buffer-same-window instead of switch-to-buffer. This preserves Dired window point when dired-auto-revert-buffer is non-nil. (Bug#27243) * test/lisp/dired-tests.el (dired-test-bug27243-01) (dired-test-bug27243-02, dired-test-bug27243-03): New tests. The first two replace a previous test that combined them; that test intermittently fails in the Hydra build system, so maybe separating the two cases will help locate the point of failure. The third test involves find-file but is here because it, like the others, is testing the effect of dired-auto-revert-buffer.
* * lisp/password-cache.el (password-data): Use a hash-tableStefan Monnier2017-07-281-1/+1
| | | | | | | | | | | | * lisp/auth-source.el (auth-source-magic): Remove. (auth-source-forget+, auth-source-forget-all-cached): Adjust to new format of password-data. (auth-source-format-cache-entry): Just use a cons. (password-cache-remove, password-cache-add, password-reset) (password-read-from-cache, password-in-cache-p): Adjust accordingly. Fixes: bug#26699
* * 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-282-25/+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 watchdog process to tramp-test36-asynchronous-requestsMichael Albinus2017-07-271-6/+18
| | | | | | | * test/lisp/net/tramp-tests.el (tramp--test-timeout-handler): New defun. (tramp-test36-asynchronous-requests): Use a watchdog process, listening for SIGUSR1.
* Dired: Support eshell-ls from the beginning if the user wants toTino Calancha2017-07-261-0/+13
| | | | | | * lisp/dired.el (dired-insert-directory): Check for eshell-ls as well (Bug#27817). * test/lisp/dired-tests.el (dired-test-bug27817): Add test.
* ; Instrument entry of tramp--test-instrument-test-caseMichael Albinus2017-07-251-2/+3
|
* ls-lisp: Add an unload function and enable lexical bindingTino Calancha2017-07-251-0/+37
| | | | | | Enable lexical binding. * lisp/ls-lisp.el (ls-lisp-unload-function): New defun. * test/lisp/ls-lisp.el (ls-lisp-unload): Add test.
* register-read-with-preview: Quit if user input C-g or ESCTino Calancha2017-07-251-0/+43
| | | | | | | * lisp/register.el (register-read-with-preview): Quit if user input C-g or ESC (bug#27634). * doc/emacs/regs.texi (Registers): Update manual. * test/lisp/register-tests.el (register-test-bug27634): Add test.
* Fix Bug#27371Michael Albinus2017-07-241-0/+8
| | | | | | | | | | | | * lisp/loadhist.el (loadhist-unload-element): Declare for different entry types of `load-history'. (loadhist--restore-autoload): New variable. (loadhist--unload-function): New defun. (unload-feature): Use `loadhist-unload-element'. Recommended by Stefan Monnier. (Bug#27371) * test/lisp/net/tramp-tests.el (tramp-test39-unload): Check, that the `tramp-file-name' structure has been unloaded.
* ; Don't keep temporary buffers alive after a dired testTino Calancha2017-07-241-11/+18
| | | | | | * test/lisp/dired-tests.el (dired-test-bug22694) (dired-test-bug25609, dired-test-bug27243) Delete all temporary dired buffers at the end.
* 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.
* * test/lisp/ibuffer-tests.el: Delete temporary files.Glenn Morris2017-07-211-0/+4
|