summaryrefslogtreecommitdiff
path: root/test/lisp
Commit message (Collapse)AuthorAgeFilesLines
* Fix calculator-string-to-number yet again (bug#47694)Eli Barzilay2021-04-111-0/+51
| | | | | | | | | | * lisp/calculator.el (calculator-string-to-number): The last bugfix changed the code to just blindly replace ".e". This has some minor problems like making "-." parse as 0.0 instead of -0.0, and ".1.e1" is parsed as 1 instead of 0.1. Instead, replace the first "." that is followed by a non-digit with ".0". Since this has had several problems over the years, add some tests too. (Also, restore the original if-indentation style.)
* Fix typo in cconvMattias Engdegård2021-04-111-0/+7
| | | | | | * lisp/emacs-lisp/cconv.el (cconv-convert): Typo. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): Add test case.
* Edebug: Disable backtracking when hitting a &define keyword.Philipp Stephani2021-04-101-0/+25
| | | | | | | | | | | | | | | | | | | Edebug doesn't deal well with backtracking out of definitions, see Bug#41988. Rather than trying to support this rare situation (e.g. by implementing a multipass parser), prevent it by adding an implicit gate. * lisp/emacs-lisp/edebug.el (edebug--match-&-spec-op): Disable backtracking when hitting a &define keyword. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-duplicate-&define): New unit test. (edebug-tests--duplicate-&define): New helper macro. * doc/lispref/edebug.texi (Backtracking): Mention &define in the list of constructs that disable backtracking. * etc/NEWS: Document new behavior.
* Fix condition-case optimiser bugMattias Engdegård2021-04-091-0/+6
| | | | | | | | * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Don't perform incorrect optimisations when a condition-case variable shadows another lexical variable. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases): New test case.
* Better compiler warning testsMattias Engdegård2021-04-091-24/+25
| | | | | | | | | | | | These changes allow all bytecomp-tests to be run interactively. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp--with-warning-test) (bytecomp--define-warning-file-test): Interpret any space in the pattern as arbitrary whitespace to tolerate line breaks. Don't abuse the expected-failure mechanism when checking for the expected absense of a warning. (bytecomp/*.el): Rewrite patterns to work with line breaks in the middle.
* Clean up bytecomp-tests.elMattias Engdegård2021-04-091-103/+47
| | | | | | | | | | | | | | | | Now all test cases are run with both lexical and dynamic binding where applicable, comparing interpreted against compiled results. Previously, almost all tests were only run with dynamic binding which was definitely not intended. * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Rename to bytecomp-tests--test-cases. (bytecomp-check-1, bytecomp-explain-1, bytecomp-tests) (bytecomp-lexbind-tests, bytecomp-lexbind-check-1) (bytecomp-lexbind-explain-1): Remove. (bytecomp-tests--eval-interpreted, bytecomp-tests--eval-compiled) (bytecomp-tests-lexbind, bytecomp-tests-dynbind) (bytecomp-tests--test-cases-lexbind-only): New.
* Use lexical-binding in loadhist.el and add testsStefan Kangas2021-04-091-0/+57
| | | | | * lisp/loadhist.el: Use lexical-binding. * test/lisp/loadhist-tests.el: New file.
* Self-TCO in `condition-case` error handlersMattias Engdegård2021-04-091-2/+12
| | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Recognise `condition-case` handlers as being in the tail position. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Extend test.
* * test/lisp/shadowfile-tests.el: Fix recent test failuresStefan Monnier2021-04-081-1/+1
| | | | (shadow--tests-cleanup): `shadow-hashtable` is now a hash table (duh!).
* Fix mistakes in bytecomp-testsMattias Engdegård2021-04-071-10/+10
| | | | | | * test/lisp/emacs-lisp/bytecomp-tests.el (byte-opt-testsuite-arith-data): Fix typos and avoid errors that made the tests less powerful than intended.
* * test/lisp/filenotify-tests.el (file-notify--test-timeout):Michael Albinus2021-04-041-0/+1
| | | | Change timing on emba.
* Remove redundant #' before lambda in testsStefan Kangas2021-04-042-46/+46
| | | | | | | | | | | | | | * test/lisp/electric-tests.el (save-electric-modes) (inhibit-in-mismatched-string-inside-ruby-comments) (inhibit-in-mismatched-string-inside-c-comments, js-mode-braces) (js-mode-braces-with-layout) (js-mode-braces-with-layout-and-indent, autowrapping-1) (autowrapping-2, autowrapping-3, autowrapping-4, autowrapping-5) (autowrapping-6, autowrapping-7): * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-relative-to-project-root): * test/src/thread-tests.el (threads-signal-early) (threads-signal-main-thread): Remove redundant #' before lambda.
* * test/lisp/filenotify-tests.el (file-notify--test-timeout): Change timing.Michael Albinus2021-04-031-1/+1
| | | | | ; * lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter): ; Remove test message.
* ; Remove spurious comment in last commitStefan Kangas2021-04-011-3/+0
|
* Use lexical-binding in executable.el and add testsStefan Kangas2021-04-011-0/+54
| | | | | * lisp/progmodes/executable.el: Use lexical-binding. * test/lisp/progmodes/executable-tests.el: New file.
* Use lexical-binding in epg-config.el and add testsStefan Kangas2021-04-011-0/+47
| | | | | | * lisp/epg-config.el: Use lexical-binding. (epg-find-configuration): Improve error message. * test/lisp/epg-config-tests.el: New file.
* Use lexical-binding in lpr.el and add rudimentary testsStefan Kangas2021-03-301-0/+41
| | | | | | * lisp/lpr.el: Use lexical-binding. Remove redundant :group args. (print-region-function): Declare MS-Windows specific function. * test/lisp/lpr-tests.el: New file.
* Merge from origin/emacs-27Glenn Morris2021-03-291-1/+3
|\ | | | | | | | | | | | | 8a92030f6a (origin/emacs-27) Fix hang in autorevert-tests.el # Conflicts: # test/lisp/autorevert-tests.el
| * Fix hang in autorevert-tests.elMichael Albinus2021-03-281-1/+3
| | | | | | | | | | * test/lisp/autorevert-tests.el (auto-revert--wait-for-revert): Apply more robust check, whether file notification is used.
| * Fix filenotify-tests.el for Solaris (bug#47262), do not mergeMichael Albinus2021-03-251-68/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/lisp/filenotify-tests.el (file-notify--test-read-event): Check also for GFamDirectoryMonitor. (file-notify--test-timeout): Increase cygwin timeout. (file-notify--test-monitor): Use `alist-get'. (file-notify--test-event-actions): New defun. (file-notify--test-with-actions-explainer): Use it. (file-notify--test-with-actions-check): Use it. If file-notify-debug is non-nil, trace received events instead of checking them. (file-notify-test03-events, file-notify-test05-file-validity) (file-notify-test07-many-events, file-notify-test08-backup) (file-notify-test09-watched-file-in-watched-dir): Handle GFamFileMonitor and GFamDirectoryMonitor.
* | Fix lisp/files-tests on MS-WindowsEli Zaretskii2021-03-271-12/+43
| | | | | | | | | | | | | | | | * test/lisp/files-tests.el (files-colon-path) (files-tests-bug-21454): Adapt to MS-DOS/Windows, where parse-colon-path needs and absolute file name with a drive letter. (files-tests-file-name-non-special-get-file-buffer): Forcefully delete the file's buffer if it happens to exist.
* | Improve remote file notificationsMichael Albinus2021-03-261-110/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/net/tramp-sh.el (tramp-get-remote-gio-file-monitor): Remove it. (tramp-sh-handle-file-notify-add-watch): Do not call it. (tramp-sh-gio-monitor-process-filter): Read monitor name. * test/lisp/filenotify-tests.el (file-notify--test-read-event) (file-notify--test-timeout): Change timings. (file-notify--test-monitor): Read remote monitor name more reliably. (file-notify-test02-rm-watch): Retrieve remote monitor name in time. (file-notify--test-event-actions): New defun. (file-notify--test-with-actions-explainer): Use it. (file-notify--test-with-actions-check): Use it. Dump traces in case of debug. (file-notify--test-with-actions): Don't stop while debugging. (file-notify-test03-events, file-notify-test04-autorevert) (file-notify-test05-file-validity) (file-notify-test07-many-events, file-notify-test08-backup) (file-notify-test09-watched-file-in-watched-dir): Adapt tests.
* | Improve failure reporting in test/lisp/electric-tests.elAlan Mackenzie2021-03-241-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | In particular, on a failure, output the test's doc string to electric-tests.log, along with all the other failure information. Fixes bug #47320. * electric-tests.el (electric-pair-test-for) New parameter doc-string. On a test failure, output the doc-string parameter with message. (electric-pair-define-test-form): Set the new variable doc-string to the generated doc string, and pass this as argument to both ert-deftest and electric-pair-test-for.
* | perl-mode: Fix regexps for fontificationHarald Jörg2021-03-241-0/+19
| | | | | | | | | | | | | | | | | | | | * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-fontify-declarations): New test to ensure consistency between perl-mode.el and cperl-mode.el (bug#47345). * lisp/progmodes/perl-mode.el (perl-font-lock-keywords-1): pick correct capture groups for "use Pack::Age;" Fontify all components of "Pack::Age", not just "Pack" (perl-font-lock-keywords-2): Use keyword-face for declarators
* | Fix cl-progv binding orderToby Cubitt2021-03-201-0/+5
| | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl-progv): Bind variables in the correct order (bug#47272).
* | Use lexical-binding in thumbs.elStefan Kangas2021-03-201-0/+34
| | | | | | | | | | * lisp/thumbs.el: Use lexical-binding. Remove redundant :group args. * test/lisp/thumbs-tests.el: New file.
* | Fix copyright lines mistakenly treated as outline headersStefan Monnier2021-03-185-5/+5
| | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/generator.el: * test/lisp/cedet/semantic-utest.el: * test/lisp/cedet/semantic/format-tests.el: * test/lisp/cedet/semantic/fw-tests.el: * test/lisp/cedet/semantic/bovine/gcc-tests.el: * test/lisp/cedet/semantic/format-resources/test-fmt.el: * test/manual/cedet/semantic-tests.el: * lisp/obsolete/inversion.el: Use only 2 semi-colons before "Copyright".
* | * test/lisp/progmodes/cperl-mode-tests.el: Silence warningsStefan Monnier2021-03-181-3/+6
| | | | | | | | (cperl-test-bug-47112): Actually obey the major-mode for the test.
* | Optimise tail calls in `and` and `or` forms in `cl-labels` functionsMattias Engdegård2021-03-181-5/+20
| | | | | | | | | | | | * lisp/emacs-lisp/cl-macs.el (cl--self-tco): Handle `and` and `or`. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--labels): Add test cases.
* | Add comint-password-prompt-regexp test for "zip -e ..."Stefan Kangas2021-03-181-0/+1
| | | | | | | | | | * test/lisp/comint-tests.el (comint-testsuite-password-strings): Add test for "zip -e ...". (Bug#47209)
* | cperl-mode: Don't interpret y_ as start of y// function.Harald Jörg2021-03-181-0/+26
| | | | | | | | | | | | | | | | * lisp/progmodes/cperl-mode.el (cperl-find-pods-heres): Avoid treating underscores as word-terminators. * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-47112): Test case for that bug (bug#47112).
* | ; Remove traces from tramp-tests.elMichael Albinus2021-03-161-3/+0
| |
* | Fix problem of image-tests.el on embaMichael Albinus2021-03-161-1/+3
| | | | | | | | | | | | | | | | * test/README: Mention $EMACS_TEST_DIRECTORY. * test/lisp/image-tests.el (image-tests--emacs-images-directory): Use `data-directory', for runs w/o of make. (image-type/from-filename): Check for `image-load-path'.
* | ; Further traces in tramp-tests.elMichael Albinus2021-03-161-1/+1
| |
* | ; Trace variables in tramp-tests.elMichael Albinus2021-03-161-0/+3
| |
* | Add three new tests for image.elStefan Kangas2021-03-151-0/+11
| | | | | | | | | | * test/lisp/image-tests.el (image-find-image) (image-type-from-file-name, image-type/from-filename): New tests.
* | Fix simple-tests--undo*Yuan Fu2021-03-121-2/+5
| | | | | | | | | | | | * test/lisp/simple-tests.el (simple-tests--undo-in-region, simple-tests--undo-equiv-table): Re-enable in batch mode. Enable 'transient-mark-mode' in temp buffer.
* | Skip recent undo tests in batch mode for nowGlenn Morris2021-03-121-1/+5
| | | | | | | | | | | | * test/lisp/simple-tests.el (simple-tests--undo-in-region): Split into separate test. Skip in batch mode for now. (simple-tests--undo-equiv-table): Skip in batch mode for now.
* | Tramp sshfs fixesMichael Albinus2021-03-121-1/+3
| | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (FUSE setup): Fix typo. * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-set-file-modes): Use `tramp-compat-set-file-modes'. * test/lisp/net/tramp-tests.el (tramp-test43-asynchronous-requests): Don't run for tramp-sshfs.
* | ; Fix typos in doc stringsMattias Engdegård2021-03-121-1/+1
| |
* | Map redo records for undo in region to 'undo-in-regionYuan Fu2021-03-111-1/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/simple.el (undo-equiv-table): Add explaination for undo-in-region, undo to the beginning of undo list and null undo. (undo): If equiv is 'undo-in-region, empty or t, set pending-undo-list to t. If the redo is undo-in-region, map buffer-undo-list to 'undo-in-region instead of t, if it is an identity mapping, map to 'empty. (undo-make-selective-list): Only continue when ulist is a proper list. * test/lisp/simple-tests.el (simple-tests--undo): Add test for undo-only in region. (simple-tests--sans-leading-nil): New helper function. (simple-tests--undo-equiv-table): New test for 'undo-equiv-table'.
* | Add remote processes to Tramp sshfs methodMichael Albinus2021-03-111-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (FUSE setup): Method sshfs supports also remote processes. * lisp/net/tramp-cache.el (tramp-get-file-property) (tramp-set-file-property): Move setting of `tramp-cache-unload-hook' out of function. * lisp/net/tramp.el (tramp-expand-args): New defun. (tramp-handle-make-process): * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band) (tramp-maybe-open-connection): * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-send-command): Use it. * lisp/net/tramp-sshfs.el (tramp-methods) <sshfs>: Adapt `tramp-mount-args'. Add `tramp-login-args', `tramp-direct-async', `tramp-remote-shell', `tramp-remote-shell-login' and `tramp-remote-shell-args'. (tramp-connection-properties): Set "direct-async-process" fir sshfs. (tramp-sshfs-file-name-handler-alist): Add `exec-path', `make-process', `process-file', `set-file-modes', `shell-command', `start-file-process', `tramp-get-remote-gid', `tramp-get-remote-uid' and `tramp-set-file-uid-gid'. (tramp-sshfs-handle-exec-path, tramp-sshfs-handle-process-file) (tramp-sshfs-handle-set-file-modes): New defuns. * test/lisp/net/tramp-tests.el (tramp-test20-file-modes) (tramp-test28-process-file, tramp-test29-start-file-process) (tramp-test30-make-process, tramp-test32-shell-command) (tramp-test32-shell-command-dont-erase-buffer) (tramp-test34-explicit-shell-file-name, tramp-test35-exec-path) (tramp-test43-asynchronous-requests): Run also for tramp-sshfs. (tramp--test-shell-file-name): New defun. (tramp-test28-process-file) (tramp-test34-explicit-shell-file-name) (tramp-test43-asynchronous-requests): Use it. (tramp-test40-special-characters-with-stat) (tramp-test40-special-characters-with-perl) (tramp-test40-special-characters-with-ls) (tramp-test41-utf8-with-stat, tramp-test41-utf8-with-perl) (tramp-test41-utf8-with-ls): Remove superfluous skip.
* | * lisp/emacs-lisp/cconv.el: Don't confuse a string for a docstringStefan Monnier2021-03-091-0/+5
| | | | | | | | | | | | | | (cconv--convert-funcbody): Check there's something after a docstring. * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-string-vs-docstring): New corresponding test.
* | Fix structure of condition object in nested 'ert-fail'.Philipp Stephani2021-03-081-1/+1
| | | | | | | | | | | | | | | | | | See the test 'ert-test-fail' for the expected structure. * lisp/emacs-lisp/ert.el (ert--should-signal-hook): Condition list should be (SYMBOL . DATA), not (SYMBOL DATA). * test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Fix unit test.
* | Add Tramp sshfs methodMichael Albinus2021-03-081-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/misc/tramp.texi (Top, Configuration): Insert sections 'FUSE-based methods' and 'FUSE setup' in menu. (Quick Start Guide): Fix @anchors. Add doas. Extend section 'Using @command{rclone}' to 'Using @acronym{FUSE}-based methods'. (External methods): Remove rclone paragraph. (FUSE-based methods, FUSE setup): New nodes. (Predefined connection information): Mention "mount-point". * etc/NEWS: Mention Tramp sshfs method. Fix typos and other oddities. * lisp/net/tramp-fuse.el: New file. * lisp/net/tramp-rclone.el (tramp-fuse): Require. (tramp-rclone-file-name-handler-alist): Replace `tramp-rclone-handle-*' by `tramp-fuse-handle-*' where appropriate. (tramp-rclone-handle-delete-directory) (tramp-rclone-handle-delete-file) (tramp-rclone-handle-directory-files) (tramp-rclone-handle-file-attributes) (tramp-rclone-handle-file-executable-p) (tramp-rclone-handle-file-name-all-completions) (tramp-rclone-handle-file-readable-p) (tramp-rclone-handle-insert-directory) (tramp-rclone-handle-insert-file-contents) (tramp-rclone-handle-make-directory, tramp-rclone-mount-point) (tramp-rclone-mounted-p, tramp-rclone-local-file-name): Remove. Functionality moved to tramp-fuse.el. (tramp-rclone-remote-file-name) (tramp-rclone-maybe-open-connection): Use `tramp-fuse-*' functions. * lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Simplify check. * lisp/net/tramp-sshfs.el: New file. * lisp/net/tramp.el: Remove TODO item. * test/lisp/net/tramp-tests.el (tramp--test-sshfs-p): New defun. (tramp-test14-delete-directory): Use it.
* | Add new face 'help-key-binding' for keybindings in helpStefan Kangas2021-03-081-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/faces.el (help-key-binding): New face. * lisp/help.el (help-for-help): Rename from 'help-for-help-internal'. Use 'substitute-command-keys' syntax. (help): Make into alias for 'help-for-help'. (help-for-help-internal): Make into obsolete alias for 'help-for-help'. (help--key-description-fontified): New function to add the 'help-key-binding' face. (help-key-description, substitute-command-keys) (describe-map-tree, help--describe-command) (help--describe-translation, describe-map): * lisp/help-fns.el (help-fns--key-bindings, describe-mode): Use above new function. * lisp/isearch.el (isearch-help-for-help-internal): Use `substitute-command-keys' syntax. * lisp/help-macro.el (make-help-screen): Use 'substitute-command-keys' and 'help--key-description-fontified'. Simplify. * src/keymap.c (describe_key_maybe_fontify): New function to add the 'help-key-binding' face to keybindings. (describe_vector): Use above new keybinding. (syms_of_keymap) <Qfont_lock_face, Qhelp_key_binding>: New DEFSYMs. (fontify_key_properties): New static variable. * lisp/tooltip.el (tooltip-show): Avoid overriding faces in specified tooltip text. * test/lisp/help-tests.el (with-substitute-command-keys-test): Don't test for text properties. (help-tests-substitute-command-keys/add-key-face) (help-tests-substitute-command-keys/add-key-face-listing): New tests.
* | Speed up xref rendering for matches on very long linesDmitry Gutov2021-03-083-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/xref.el (xref--insert-xrefs): Cut up the current line into pieces here for multiple matches's summaries, so that xref--insert-xrefs can do less work (bug#46859). (xref--insert-xrefs): Do less work. (xref--outdated-p): Update accordingly to how the summary creation logic changed. (xref--buf-pairs-iterator): Update to the new calling convention. (xref-location-column): Effectively rename back to xref-file-location-column since the generic version is now unused. * test/lisp/progmodes/xref-tests.el (xref-matches-in-directory-finds-two-matches-on-the-same-line) (xref-matches-in-directory-finds-an-empty-line-regexp-match): Adjust to the xref-location-column change. (xref-matches-in-files-trims-summary-for-matches-on-same-line): New test. * test/lisp/progmodes/xref-resources/file1.txt: Change contents slightly to test the new xref--outdated-p code.
* | Xref test improvementsDmitry Gutov2021-03-081-12/+21
| | | | | | | | | | | | | | | | * test/lisp/progmodes/xref-tests.el (xref--xref-file-name-display-is-abs): Fix not to rely on the default value. (xref-matches-in-files-includes-matches-from-all-the-files): New test.
* | * lisp/cedet/semantic/bovine.el: Fix recent regressionStefan Monnier2021-03-071-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conversion to `lexical-binding` introduced a regression because `bovine/c.el` relied on inspecting the local variable `lse` in one of its callers. (semantic-bovinate-stream): Bind `lse` dynamically, because of `semantic-parse-region-c-mode`. (semantic-bovinate-nonterminal-check-map): Rename from `semantic-bovinate-nonterminal-check-obarray` to hold some other kind of table. (semantic-bovinate-nonterminal-check): Use a hash-table instead of an obarray. * lisp/cedet/semantic/bovine/c.el (semantic-parse-region-c-mode): Declare use of `lse` via dynamic scoping. * test/lisp/cedet/semantic-utest-c.el (semantic-test-c-preprocessor-simulation): Re-enable test.
* | Tag a semantic test that seems to hang recentlyGlenn Morris2021-03-071-1/+1
| | | | | | | | | | * test/lisp/cedet/semantic-utest-c.el (semantic-test-c-preprocessor-simulation): Mark as unstable.