aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2025-09-12 12:21:48 +0200
committerMichael Albinus2025-09-12 12:21:48 +0200
commit43f507f4308a9c4b3bdcb1ef7614e29914c76561 (patch)
tree2d341c4a377ed7b027f127097b251713b5888b3f /test
parent464216ca737a3b98175b02244251878508e1ca15 (diff)
downloademacs-43f507f4308a9c4b3bdcb1ef7614e29914c76561.tar.gz
emacs-43f507f4308a9c4b3bdcb1ef7614e29914c76561.zip
Minor edits in tramp-tests.el
* test/lisp/net/tramp-tests.el (tramp-test16-file-expand-wildcards) (tramp-test26-interactive-file-name-completion): Prefer #'string-lessp over 'string<. (tramp--test-ange-ftp-p, tramp-test47-read-password) (tramp-test47-read-otp-password): Use function read syntax.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/tramp-tests.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 8c230f43cf3..7f8b71180d2 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -3460,41 +3460,43 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
3460 ;; `sort' works destructive. 3460 ;; `sort' works destructive.
3461 (should 3461 (should
3462 (equal (file-expand-wildcards "*") 3462 (equal (file-expand-wildcards "*")
3463 (sort (copy-sequence '("foo" "bar" "baz")) 'string<))) 3463 (sort (copy-sequence '("foo" "bar" "baz")) #'string-lessp)))
3464 (should 3464 (should
3465 (equal (file-expand-wildcards "ba?") 3465 (equal (file-expand-wildcards "ba?")
3466 (sort (copy-sequence '("bar" "baz")) 'string<))) 3466 (sort (copy-sequence '("bar" "baz")) #'string-lessp)))
3467 (should 3467 (should
3468 (equal (file-expand-wildcards "ba[rz]") 3468 (equal (file-expand-wildcards "ba[rz]")
3469 (sort (copy-sequence '("bar" "baz")) 'string<))) 3469 (sort (copy-sequence '("bar" "baz")) #'string-lessp)))
3470 3470
3471 (should 3471 (should
3472 (equal 3472 (equal
3473 (file-expand-wildcards "*" 'full) 3473 (file-expand-wildcards "*" 'full)
3474 (sort 3474 (sort
3475 (copy-sequence `(,tmp-name2 ,tmp-name3 ,tmp-name4)) 'string<))) 3475 (copy-sequence `(,tmp-name2 ,tmp-name3 ,tmp-name4))
3476 #'string-lessp)))
3476 (should 3477 (should
3477 (equal 3478 (equal
3478 (file-expand-wildcards "ba?" 'full) 3479 (file-expand-wildcards "ba?" 'full)
3479 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<))) 3480 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) #'string-lessp)))
3480 (should 3481 (should
3481 (equal 3482 (equal
3482 (file-expand-wildcards "ba[rz]" 'full) 3483 (file-expand-wildcards "ba[rz]" 'full)
3483 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<))) 3484 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) #'string-lessp)))
3484 3485
3485 (should 3486 (should
3486 (equal 3487 (equal
3487 (file-expand-wildcards (concat tmp-name1 "/" "*")) 3488 (file-expand-wildcards (concat tmp-name1 "/" "*"))
3488 (sort 3489 (sort
3489 (copy-sequence `(,tmp-name2 ,tmp-name3 ,tmp-name4)) 'string<))) 3490 (copy-sequence `(,tmp-name2 ,tmp-name3 ,tmp-name4))
3491 #'string-lessp)))
3490 (should 3492 (should
3491 (equal 3493 (equal
3492 (file-expand-wildcards (concat tmp-name1 "/" "ba?")) 3494 (file-expand-wildcards (concat tmp-name1 "/" "ba?"))
3493 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<))) 3495 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) #'string-lessp)))
3494 (should 3496 (should
3495 (equal 3497 (equal
3496 (file-expand-wildcards (concat tmp-name1 "/" "ba[rz]")) 3498 (file-expand-wildcards (concat tmp-name1 "/" "ba[rz]"))
3497 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<)))) 3499 (sort (copy-sequence `(,tmp-name3 ,tmp-name4)) #'string-lessp))))
3498 3500
3499 ;; Cleanup. 3501 ;; Cleanup.
3500 (ignore-errors (delete-directory tmp-name1 'recursive)))))) 3502 (ignore-errors (delete-directory tmp-name1 'recursive))))))
@@ -5252,7 +5254,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
5252 (member (caddr test-and-result) completions)) 5254 (member (caddr test-and-result) completions))
5253 (should 5255 (should
5254 (equal 5256 (equal
5255 (caddr test-and-result) (sort completions))))))))))) 5257 (caddr test-and-result)
5258 (sort completions #'string-lessp)))))))))))
5256 5259
5257 ;; Cleanup. 5260 ;; Cleanup.
5258 (when tramp-trace 5261 (when tramp-trace
@@ -7340,7 +7343,7 @@ This requires restrictions of file name syntax."
7340 "Check, whether Ange-FTP is used." 7343 "Check, whether Ange-FTP is used."
7341 (eq 7344 (eq
7342 (tramp-find-foreign-file-name-handler tramp-test-vec) 7345 (tramp-find-foreign-file-name-handler tramp-test-vec)
7343 'tramp-ftp-file-name-handler)) 7346 #'tramp-ftp-file-name-handler))
7344 7347
7345(defun tramp--test-asynchronous-processes-p () 7348(defun tramp--test-asynchronous-processes-p ()
7346 "Whether asynchronous processes tests are run. 7349 "Whether asynchronous processes tests are run.
@@ -8306,7 +8309,7 @@ process sentinels. They shall not disturb each other."
8306 ;; Reading password from auth-source works. We use the netrc 8309 ;; Reading password from auth-source works. We use the netrc
8307 ;; backend; the other backends shall behave similar. 8310 ;; backend; the other backends shall behave similar.
8308 ;; Macro `ert-with-temp-file' was introduced in Emacs 29.1. 8311 ;; Macro `ert-with-temp-file' was introduced in Emacs 29.1.
8309 (with-no-warnings (when (symbol-plist 'ert-with-temp-file) 8312 (with-no-warnings (when (symbol-plist #'ert-with-temp-file)
8310 (tramp-cleanup-connection tramp-test-vec 'keep-debug) 8313 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
8311 (setq mocked-input nil) 8314 (setq mocked-input nil)
8312 (auth-source-forget-all-cached) 8315 (auth-source-forget-all-cached)
@@ -8319,7 +8322,7 @@ process sentinels. They shall not disturb each other."
8319 (should (file-exists-p ert-remote-temporary-file-directory)))))) 8322 (should (file-exists-p ert-remote-temporary-file-directory))))))
8320 8323
8321 ;; Checking session-timeout. 8324 ;; Checking session-timeout.
8322 (with-no-warnings (when (symbol-plist 'ert-with-temp-file) 8325 (with-no-warnings (when (symbol-plist #'ert-with-temp-file)
8323 (tramp-cleanup-connection tramp-test-vec 'keep-debug) 8326 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
8324 (let ((tramp-connection-properties 8327 (let ((tramp-connection-properties
8325 (cons '(nil "session-timeout" 1) 8328 (cons '(nil "session-timeout" 1)
@@ -8395,7 +8398,7 @@ process sentinels. They shall not disturb each other."
8395 8398
8396 ;; The password shouldn't be read from auth-source. 8399 ;; The password shouldn't be read from auth-source.
8397 ;; Macro `ert-with-temp-file' was introduced in Emacs 29.1. 8400 ;; Macro `ert-with-temp-file' was introduced in Emacs 29.1.
8398 (with-no-warnings (when (symbol-plist 'ert-with-temp-file) 8401 (with-no-warnings (when (symbol-plist #'ert-with-temp-file)
8399 (tramp-cleanup-connection tramp-test-vec 'keep-debug) 8402 (tramp-cleanup-connection tramp-test-vec 'keep-debug)
8400 (setq mocked-input nil) 8403 (setq mocked-input nil)
8401 (auth-source-forget-all-cached) 8404 (auth-source-forget-all-cached)
@@ -8848,7 +8851,7 @@ Since it unloads Tramp, it shall be the last test to run."
8848 (string-match-p (rx bol "with" (| "tramp" "parsed")) (symbol-name x)) 8851 (string-match-p (rx bol "with" (| "tramp" "parsed")) (symbol-name x))
8849 ;; `tramp-register-archive-file-name-handler' is autoloaded 8852 ;; `tramp-register-archive-file-name-handler' is autoloaded
8850 ;; in Emacs < 29.1. 8853 ;; in Emacs < 29.1.
8851 (not (eq 'tramp-register-archive-file-name-handler x)) 8854 (not (eq #'tramp-register-archive-file-name-handler x))
8852 ;; `tramp-compat-rx' is autoloaded in Emacs 29.1. 8855 ;; `tramp-compat-rx' is autoloaded in Emacs 29.1.
8853 (not (eq 'tramp-compat-rx x)) 8856 (not (eq 'tramp-compat-rx x))
8854 (not (string-match-p 8857 (not (string-match-p