aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el31
1 files changed, 10 insertions, 21 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 9bca6a03754..5fde783087e 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -297,16 +297,6 @@ is greater than 10.
297 (tramp--test-message 297 (tramp--test-message
298 "%s %f sec" ,message (float-time (time-subtract nil start)))))) 298 "%s %f sec" ,message (float-time (time-subtract nil start))))))
299 299
300;; `always' is introduced with Emacs 28.1.
301(defalias 'tramp--test-always
302 (if (fboundp 'always)
303 #'always
304 (lambda (&rest _arguments)
305 "Do nothing and return t.
306This function accepts any number of ARGUMENTS, but ignores them.
307Also see `ignore'."
308 t)))
309
310(ert-deftest tramp-test00-availability () 300(ert-deftest tramp-test00-availability ()
311 "Test availability of Tramp functions." 301 "Test availability of Tramp functions."
312 :expected-result (if (tramp--test-enabled) :passed :failed) 302 :expected-result (if (tramp--test-enabled) :passed :failed)
@@ -2563,9 +2553,9 @@ This checks also `file-name-as-directory', `file-name-directory',
2563 ;; `tramp-test39-make-lock-file-name'. 2553 ;; `tramp-test39-make-lock-file-name'.
2564 2554
2565 ;; Do not overwrite if excluded. 2555 ;; Do not overwrite if excluded.
2566 (cl-letf (((symbol-function #'y-or-n-p) #'tramp--test-always) 2556 (cl-letf (((symbol-function #'y-or-n-p) #'tramp-compat-always)
2567 ;; Ange-FTP. 2557 ;; Ange-FTP.
2568 ((symbol-function 'yes-or-no-p) #'tramp--test-always)) 2558 ((symbol-function 'yes-or-no-p) #'tramp-compat-always))
2569 (write-region "foo" nil tmp-name nil nil nil 'mustbenew)) 2559 (write-region "foo" nil tmp-name nil nil nil 'mustbenew))
2570 (should-error 2560 (should-error
2571 (cl-letf (((symbol-function #'y-or-n-p) #'ignore) 2561 (cl-letf (((symbol-function #'y-or-n-p) #'ignore)
@@ -3991,7 +3981,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
3991 (should-error 3981 (should-error
3992 (make-symbolic-link tmp-name1 tmp-name2 0) 3982 (make-symbolic-link tmp-name1 tmp-name2 0)
3993 :type 'file-already-exists))) 3983 :type 'file-already-exists)))
3994 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always)) 3984 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always))
3995 (make-symbolic-link tmp-name1 tmp-name2 0) 3985 (make-symbolic-link tmp-name1 tmp-name2 0)
3996 (should 3986 (should
3997 (string-equal 3987 (string-equal
@@ -4071,7 +4061,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
4071 (should-error 4061 (should-error
4072 (add-name-to-file tmp-name1 tmp-name2 0) 4062 (add-name-to-file tmp-name1 tmp-name2 0)
4073 :type 'file-already-exists)) 4063 :type 'file-already-exists))
4074 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always)) 4064 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always))
4075 (add-name-to-file tmp-name1 tmp-name2 0) 4065 (add-name-to-file tmp-name1 tmp-name2 0)
4076 (should (file-regular-p tmp-name2))) 4066 (should (file-regular-p tmp-name2)))
4077 (add-name-to-file tmp-name1 tmp-name2 'ok-if-already-exists) 4067 (add-name-to-file tmp-name1 tmp-name2 'ok-if-already-exists)
@@ -5202,7 +5192,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
5202 ;; `file-truename' does it by side-effect. Suppress 5192 ;; `file-truename' does it by side-effect. Suppress
5203 ;; `tramp--test-enabled', in order to keep the connection. 5193 ;; `tramp--test-enabled', in order to keep the connection.
5204 ;; Suppress "Process ... finished" messages. 5194 ;; Suppress "Process ... finished" messages.
5205 (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always) 5195 (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp-compat-always)
5206 ((symbol-function #'internal-default-process-sentinel) 5196 ((symbol-function #'internal-default-process-sentinel)
5207 #'ignore)) 5197 #'ignore))
5208 (file-truename ert-remote-temporary-file-directory) 5198 (file-truename ert-remote-temporary-file-directory)
@@ -6410,7 +6400,7 @@ INPUT, if non-nil, is a string sent to the process."
6410 (tramp-cleanup-connection 6400 (tramp-cleanup-connection
6411 tramp-test-vec 'keep-debug 'keep-password) 6401 tramp-test-vec 'keep-debug 'keep-password)
6412 (cl-letf (((symbol-function #'yes-or-no-p) 6402 (cl-letf (((symbol-function #'yes-or-no-p)
6413 #'tramp--test-always)) 6403 #'tramp-compat-always))
6414 (should (stringp (make-auto-save-file-name)))))))) 6404 (should (stringp (make-auto-save-file-name))))))))
6415 6405
6416 ;; Cleanup. 6406 ;; Cleanup.
@@ -6556,8 +6546,7 @@ INPUT, if non-nil, is a string sent to the process."
6556 :type 'file-error)) 6546 :type 'file-error))
6557 (tramp-cleanup-connection 6547 (tramp-cleanup-connection
6558 tramp-test-vec 'keep-debug 'keep-password) 6548 tramp-test-vec 'keep-debug 'keep-password)
6559 (cl-letf (((symbol-function #'yes-or-no-p) 6549 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always))
6560 #'tramp--test-always))
6561 (should (stringp (car (find-backup-file-name tmp-name1))))))) 6550 (should (stringp (car (find-backup-file-name tmp-name1)))))))
6562 6551
6563 ;; Cleanup. 6552 ;; Cleanup.
@@ -6712,8 +6701,7 @@ INPUT, if non-nil, is a string sent to the process."
6712 :type 'file-error)) 6701 :type 'file-error))
6713 (tramp-cleanup-connection 6702 (tramp-cleanup-connection
6714 tramp-test-vec 'keep-debug 'keep-password) 6703 tramp-test-vec 'keep-debug 'keep-password)
6715 (cl-letf (((symbol-function #'yes-or-no-p) 6704 (cl-letf (((symbol-function #'yes-or-no-p) #'tramp-compat-always))
6716 #'tramp--test-always))
6717 (write-region "foo" nil tmp-name1)))) 6705 (write-region "foo" nil tmp-name1))))
6718 6706
6719 ;; Cleanup. 6707 ;; Cleanup.
@@ -6783,7 +6771,8 @@ INPUT, if non-nil, is a string sent to the process."
6783 (should (file-locked-p tmp-name))))) 6771 (should (file-locked-p tmp-name)))))
6784 6772
6785 ;; `save-buffer' removes the file lock. 6773 ;; `save-buffer' removes the file lock.
6786 (cl-letf (((symbol-function 'yes-or-no-p) #'tramp--test-always) 6774 (cl-letf (((symbol-function 'yes-or-no-p)
6775 #'tramp-compat-always)
6787 ((symbol-function 'read-char-choice) 6776 ((symbol-function 'read-char-choice)
6788 (lambda (&rest _) ?y))) 6777 (lambda (&rest _) ?y)))
6789 (should (buffer-modified-p)) 6778 (should (buffer-modified-p))