diff options
| author | Glenn Morris | 2017-11-29 17:12:05 -0800 |
|---|---|---|
| committer | Glenn Morris | 2017-11-29 17:12:05 -0800 |
| commit | 7aedb6116ffaa6590c86e70380f533385c1ced58 (patch) | |
| tree | 186436d57261f5bd0e5f1bff8844615c17b46128 /test | |
| parent | 728d259243206136387b6b59c2efb7de8cd9f6ed (diff) | |
| parent | 02d114d6b85e02132d5f99ead517b69dbdd77e35 (diff) | |
| download | emacs-7aedb6116ffaa6590c86e70380f533385c1ced58.tar.gz emacs-7aedb6116ffaa6590c86e70380f533385c1ced58.zip | |
Merge from origin/emacs-26
02d114d6b8 * lisp/tree-widget.el (tree-widget-end-guide): Escape it. ...
0a85d12474 Fix ELisp "Warning Tips"
06d05fec84 Fix Bug#29163
ac64fdb248 Harden exec_byte_code against redefining 'error'
700f74e4c8 Fix Edebug specs for if-let* and and-let* (Bug#29236)
0ded1b41a9 Fix Edebug's handling of dotted specs (bug#6415)
16358d4fcb Improve documentation of "constant" symbols
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el | 4 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/edebug-tests.el | 14 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/subr-x-tests.el | 2 | ||||
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 44 |
4 files changed, 52 insertions, 12 deletions
diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el index f52a2b1896c..ca49dcd213d 100644 --- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el +++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el | |||
| @@ -126,5 +126,9 @@ | |||
| 126 | !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") | 126 | !start!(with-current-buffer (get-buffer-create "*edebug-test-code-buffer*") |
| 127 | !body!(format "current-buffer: %s" (current-buffer)))) | 127 | !body!(format "current-buffer: %s" (current-buffer)))) |
| 128 | 128 | ||
| 129 | (defun edebug-test-code-use-destructuring-bind () | ||
| 130 | (let ((two 2) (three 3)) | ||
| 131 | (cl-destructuring-bind (x . y) (cons two three) (+ x!x! y!y!)))) | ||
| 132 | |||
| 129 | (provide 'edebug-test-code) | 133 | (provide 'edebug-test-code) |
| 130 | ;;; edebug-test-code.el ends here | 134 | ;;; edebug-test-code.el ends here |
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el index 02f4d1c5abe..f6c016cdf80 100644 --- a/test/lisp/emacs-lisp/edebug-tests.el +++ b/test/lisp/emacs-lisp/edebug-tests.el | |||
| @@ -899,5 +899,19 @@ test and possibly others should be updated." | |||
| 899 | "@g" (should (equal edebug-tests-@-result | 899 | "@g" (should (equal edebug-tests-@-result |
| 900 | '(#("abcd" 1 3 (face italic)) 511)))))) | 900 | '(#("abcd" 1 3 (face italic)) 511)))))) |
| 901 | 901 | ||
| 902 | (ert-deftest edebug-tests-dotted-forms () | ||
| 903 | "Edebug can instrument code matching the tail of a dotted spec (Bug#6415)." | ||
| 904 | (edebug-tests-with-normal-env | ||
| 905 | (edebug-tests-setup-@ "use-destructuring-bind" nil t) | ||
| 906 | (edebug-tests-run-kbd-macro | ||
| 907 | "@ SPC SPC SPC SPC SPC SPC" | ||
| 908 | (edebug-tests-should-be-at "use-destructuring-bind" "x") | ||
| 909 | (edebug-tests-should-match-result-in-messages "2 (#o2, #x2, ?\\C-b)") | ||
| 910 | "SPC" | ||
| 911 | (edebug-tests-should-be-at "use-destructuring-bind" "y") | ||
| 912 | (edebug-tests-should-match-result-in-messages "3 (#o3, #x3, ?\\C-c)") | ||
| 913 | "g" | ||
| 914 | (should (equal edebug-tests-@-result 5))))) | ||
| 915 | |||
| 902 | (provide 'edebug-tests) | 916 | (provide 'edebug-tests) |
| 903 | ;;; edebug-tests.el ends here | 917 | ;;; edebug-tests.el ends here |
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el index 0e8871d9a9c..0187f39d15d 100644 --- a/test/lisp/emacs-lisp/subr-x-tests.el +++ b/test/lisp/emacs-lisp/subr-x-tests.el | |||
| @@ -403,7 +403,7 @@ | |||
| 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) | 403 | (should-error (eval '(and-let* (nil (x 1))) lexical-binding) |
| 404 | :type 'setting-constant) | 404 | :type 'setting-constant) |
| 405 | (should (equal nil (and-let* ((nil) (x 1))))) | 405 | (should (equal nil (and-let* ((nil) (x 1))))) |
| 406 | (should-error (eval (and-let* (2 (x 1))) lexical-binding) | 406 | (should-error (eval '(and-let* (2 (x 1))) lexical-binding) |
| 407 | :type 'wrong-type-argument) | 407 | :type 'wrong-type-argument) |
| 408 | (should (equal 1 (and-let* ((2) (x 1))))) | 408 | (should (equal 1 (and-let* ((2) (x 1))))) |
| 409 | (should (equal 2 (and-let* ((x 1) (2))))) | 409 | (should (equal 2 (and-let* ((x 1) (2))))) |
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index efc2c578d59..8310003d9b1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -3627,11 +3627,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3627 | (skip-unless (tramp--test-enabled)) | 3627 | (skip-unless (tramp--test-enabled)) |
| 3628 | ;; We test it only for the mock-up connection; otherwise there might | 3628 | ;; We test it only for the mock-up connection; otherwise there might |
| 3629 | ;; be problems with the used ports. | 3629 | ;; be problems with the used ports. |
| 3630 | (skip-unless | 3630 | (skip-unless (and (eq tramp-syntax 'default) |
| 3631 | (and | 3631 | (tramp--test-mock-p))) |
| 3632 | (eq tramp-syntax 'default) | ||
| 3633 | (string-equal | ||
| 3634 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method)))) | ||
| 3635 | 3632 | ||
| 3636 | ;; We force a reconnect, in order to have a clean environment. | 3633 | ;; We force a reconnect, in order to have a clean environment. |
| 3637 | (dolist (dir `(,tramp-test-temporary-file-directory | 3634 | (dolist (dir `(,tramp-test-temporary-file-directory |
| @@ -4041,6 +4038,12 @@ Several special characters do not work properly there." | |||
| 4041 | (file-truename tramp-test-temporary-file-directory) nil | 4038 | (file-truename tramp-test-temporary-file-directory) nil |
| 4042 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) | 4039 | (string-match "^HP-UX" (tramp-get-connection-property v "uname" "")))) |
| 4043 | 4040 | ||
| 4041 | (defun tramp--test-mock-p () | ||
| 4042 | "Check, whether the mock method is used. | ||
| 4043 | This does not support external Emacs calls." | ||
| 4044 | (string-equal | ||
| 4045 | "mock" (file-remote-p tramp-test-temporary-file-directory 'method))) | ||
| 4046 | |||
| 4044 | (defun tramp--test-rsync-p () | 4047 | (defun tramp--test-rsync-p () |
| 4045 | "Check, whether the rsync method is used. | 4048 | "Check, whether the rsync method is used. |
| 4046 | This does not support special file names." | 4049 | This does not support special file names." |
| @@ -4496,8 +4499,7 @@ process sentinels. They shall not disturb each other." | |||
| 4496 | ;; We must distinguish due to performance reasons. | 4499 | ;; We must distinguish due to performance reasons. |
| 4497 | (timer-operation | 4500 | (timer-operation |
| 4498 | (cond | 4501 | (cond |
| 4499 | ((string-equal "mock" (file-remote-p tmp-name 'method)) | 4502 | ((tramp--test-mock-p) 'vc-registered) |
| 4500 | 'vc-registered) | ||
| 4501 | (t 'file-attributes))) | 4503 | (t 'file-attributes))) |
| 4502 | timer buffers kill-buffer-query-functions) | 4504 | timer buffers kill-buffer-query-functions) |
| 4503 | 4505 | ||
| @@ -4615,7 +4617,27 @@ process sentinels. They shall not disturb each other." | |||
| 4615 | (ignore-errors (cancel-timer timer)) | 4617 | (ignore-errors (cancel-timer timer)) |
| 4616 | (ignore-errors (delete-directory tmp-name 'recursive))))))) | 4618 | (ignore-errors (delete-directory tmp-name 'recursive))))))) |
| 4617 | 4619 | ||
| 4618 | (ert-deftest tramp-test42-recursive-load () | 4620 | (ert-deftest tramp-test42-auto-load () |
| 4621 | "Check that Tramp autoloads properly." | ||
| 4622 | (skip-unless (tramp--test-enabled)) | ||
| 4623 | (skip-unless (not (tramp--test-mock-p))) | ||
| 4624 | |||
| 4625 | (let ((default-directory (expand-file-name temporary-file-directory))) | ||
| 4626 | (let ((code | ||
| 4627 | (format | ||
| 4628 | "(message \"Tramp loaded: %%s\" (consp (file-attributes \"%s\")))" | ||
| 4629 | tramp-test-temporary-file-directory))) | ||
| 4630 | (should | ||
| 4631 | (string-match | ||
| 4632 | "Tramp loaded: t[\n\r]+" | ||
| 4633 | (shell-command-to-string | ||
| 4634 | (format | ||
| 4635 | "%s -batch -Q -L %s --eval %s" | ||
| 4636 | (expand-file-name invocation-name invocation-directory) | ||
| 4637 | (mapconcat 'shell-quote-argument load-path " -L ") | ||
| 4638 | (shell-quote-argument code)))))))) | ||
| 4639 | |||
| 4640 | (ert-deftest tramp-test43-recursive-load () | ||
| 4619 | "Check that Tramp does not fail due to recursive load." | 4641 | "Check that Tramp does not fail due to recursive load." |
| 4620 | (skip-unless (tramp--test-enabled)) | 4642 | (skip-unless (tramp--test-enabled)) |
| 4621 | 4643 | ||
| @@ -4638,7 +4660,7 @@ process sentinels. They shall not disturb each other." | |||
| 4638 | (mapconcat 'shell-quote-argument load-path " -L ") | 4660 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4639 | (shell-quote-argument code)))))))) | 4661 | (shell-quote-argument code)))))))) |
| 4640 | 4662 | ||
| 4641 | (ert-deftest tramp-test43-remote-load-path () | 4663 | (ert-deftest tramp-test44-remote-load-path () |
| 4642 | "Check that Tramp autoloads its packages with remote `load-path'." | 4664 | "Check that Tramp autoloads its packages with remote `load-path'." |
| 4643 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. | 4665 | ;; `tramp-cleanup-all-connections' is autoloaded from tramp-cmds.el. |
| 4644 | ;; It shall still work, when a remote file name is in the | 4666 | ;; It shall still work, when a remote file name is in the |
| @@ -4661,7 +4683,7 @@ process sentinels. They shall not disturb each other." | |||
| 4661 | (mapconcat 'shell-quote-argument load-path " -L ") | 4683 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4662 | (shell-quote-argument code))))))) | 4684 | (shell-quote-argument code))))))) |
| 4663 | 4685 | ||
| 4664 | (ert-deftest tramp-test44-delay-load () | 4686 | (ert-deftest tramp-test45-delay-load () |
| 4665 | "Check that Tramp is loaded lazily, only when needed." | 4687 | "Check that Tramp is loaded lazily, only when needed." |
| 4666 | ;; Tramp is neither loaded at Emacs startup, nor when completing a | 4688 | ;; Tramp is neither loaded at Emacs startup, nor when completing a |
| 4667 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file | 4689 | ;; non-Tramp file name like "/foo". Completing a Tramp-alike file |
| @@ -4688,7 +4710,7 @@ process sentinels. They shall not disturb each other." | |||
| 4688 | (mapconcat 'shell-quote-argument load-path " -L ") | 4710 | (mapconcat 'shell-quote-argument load-path " -L ") |
| 4689 | (shell-quote-argument (format code tm))))))))) | 4711 | (shell-quote-argument (format code tm))))))))) |
| 4690 | 4712 | ||
| 4691 | (ert-deftest tramp-test45-unload () | 4713 | (ert-deftest tramp-test46-unload () |
| 4692 | "Check that Tramp and its subpackages unload completely. | 4714 | "Check that Tramp and its subpackages unload completely. |
| 4693 | Since it unloads Tramp, it shall be the last test to run." | 4715 | Since it unloads Tramp, it shall be the last test to run." |
| 4694 | :tags '(:expensive-test) | 4716 | :tags '(:expensive-test) |