diff options
| author | Michael Albinus | 2025-05-15 15:15:22 +0200 |
|---|---|---|
| committer | Michael Albinus | 2025-05-15 15:15:22 +0200 |
| commit | 16bfbc6fe312526cec8a331a759615ffe3eb4523 (patch) | |
| tree | 8dfdc12919e709c605e8b3170f7592e0a2e29058 | |
| parent | f0ac271da385a81a3f537f48a67d59d0057f921e (diff) | |
| download | emacs-16bfbc6fe312526cec8a331a759615ffe3eb4523.tar.gz emacs-16bfbc6fe312526cec8a331a759615ffe3eb4523.zip | |
; Tramp test fixes
* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion): Simplify.
(tramp--test-putty-p): Fix docstring.
(tramp--test-scp-p): New defun.
(tramp-test42-utf8): Use it.
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 84f864e2d62..4fe3fca0df8 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -5096,9 +5096,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 5096 | (dolist | 5096 | (dolist |
| 5097 | (test-and-result | 5097 | (test-and-result |
| 5098 | ;; These are triples of strings (TEST-STRING | 5098 | ;; These are triples of strings (TEST-STRING |
| 5099 | ;; RESULT-CHECK COMPLETION-CHECK). RESULT-CHECK | 5099 | ;; RESULT-CHECK COMPLETION-CHECK). |
| 5100 | ;; could be not unique, in this case it is a list | ||
| 5101 | ;; (RESULT1 RESULT2 ...). | ||
| 5102 | (append | 5100 | (append |
| 5103 | ;; Complete method name. | 5101 | ;; Complete method name. |
| 5104 | (unless (string-empty-p tramp-method-regexp) | 5102 | (unless (string-empty-p tramp-method-regexp) |
| @@ -5124,11 +5122,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 5124 | ipv6-prefix | 5122 | ipv6-prefix |
| 5125 | (substring-no-properties | 5123 | (substring-no-properties |
| 5126 | host 0 (min 2 (length host)))) | 5124 | host 0 (min 2 (length host)))) |
| 5127 | (,(concat | 5125 | ,(concat |
| 5128 | tramp-prefix-format hop method-string host-string) | 5126 | tramp-prefix-format hop method-string |
| 5129 | ,(concat | 5127 | default-user-string host-string) |
| 5130 | tramp-prefix-format hop method-string | ||
| 5131 | default-user-string host-string)) | ||
| 5132 | ,host-string))) | 5128 | ,host-string))) |
| 5133 | ;; Complete user and host name. | 5129 | ;; Complete user and host name. |
| 5134 | (unless (or (tramp-string-empty-or-nil-p user) | 5130 | (unless (or (tramp-string-empty-or-nil-p user) |
| @@ -5169,14 +5165,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 5169 | ;; (tramp--test-message | 5165 | ;; (tramp--test-message |
| 5170 | ;; "syntax: %s style: %s test: %s result: %s" | 5166 | ;; "syntax: %s style: %s test: %s result: %s" |
| 5171 | ;; syntax style test result) | 5167 | ;; syntax style test result) |
| 5172 | (if (stringp (cadr test-and-result)) | 5168 | (should (string-prefix-p (cadr test-and-result) result))) |
| 5173 | (should | ||
| 5174 | (string-prefix-p (cadr test-and-result) result)) | ||
| 5175 | (should | ||
| 5176 | (let (res) | ||
| 5177 | (dolist (elem (cadr test-and-result) res) | ||
| 5178 | (setq | ||
| 5179 | res (or res (string-prefix-p elem result)))))))) | ||
| 5180 | 5169 | ||
| 5181 | (with-current-buffer "*Completions*" | 5170 | (with-current-buffer "*Completions*" |
| 5182 | ;; We must remove leading `default-directory'. | 5171 | ;; We must remove leading `default-directory'. |
| @@ -7379,7 +7368,7 @@ This does not support external Emacs calls." | |||
| 7379 | (tramp-method-out-of-band-p tramp-test-vec 1)) | 7368 | (tramp-method-out-of-band-p tramp-test-vec 1)) |
| 7380 | 7369 | ||
| 7381 | (defun tramp--test-putty-p () | 7370 | (defun tramp--test-putty-p () |
| 7382 | "Check, whether the method method usaes PuTTY. | 7371 | "Check, whether the method uses PuTTY. |
| 7383 | This does not support connection share for more than two connections." | 7372 | This does not support connection share for more than two connections." |
| 7384 | (member | 7373 | (member |
| 7385 | (file-remote-p ert-remote-temporary-file-directory 'method) | 7374 | (file-remote-p ert-remote-temporary-file-directory 'method) |
| @@ -7396,6 +7385,15 @@ This does not support special file names." | |||
| 7396 | (string-equal | 7385 | (string-equal |
| 7397 | "rsync" (file-remote-p ert-remote-temporary-file-directory 'method))) | 7386 | "rsync" (file-remote-p ert-remote-temporary-file-directory 'method))) |
| 7398 | 7387 | ||
| 7388 | (defun tramp--test-scp-p () | ||
| 7389 | "Check, whether an scp method is used. | ||
| 7390 | This does not support quoted special characters in recent sshd | ||
| 7391 | implementations." | ||
| 7392 | ;; Detected with OpenSSH_9.9p1. | ||
| 7393 | (member | ||
| 7394 | (file-remote-p ert-remote-temporary-file-directory 'method) | ||
| 7395 | '("pscp" "scp" "scpx"))) | ||
| 7396 | |||
| 7399 | (defun tramp--test-sh-p () | 7397 | (defun tramp--test-sh-p () |
| 7400 | "Check, whether the remote host runs a based method from tramp-sh.el." | 7398 | "Check, whether the remote host runs a based method from tramp-sh.el." |
| 7401 | (tramp-sh-file-name-handler-p tramp-test-vec)) | 7399 | (tramp-sh-file-name-handler-p tramp-test-vec)) |
| @@ -7768,6 +7766,7 @@ This requires restrictions of file name syntax." | |||
| 7768 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 620s | 7766 | (skip-unless (not (getenv "EMACS_HYDRA_CI"))) ; SLOW ~ 620s |
| 7769 | (skip-unless (not (tramp--test-container-p))) | 7767 | (skip-unless (not (tramp--test-container-p))) |
| 7770 | (skip-unless (not (tramp--test-rsync-p))) | 7768 | (skip-unless (not (tramp--test-rsync-p))) |
| 7769 | (skip-unless (not (tramp--test-scp-p))) | ||
| 7771 | (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p))) | 7770 | (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p))) |
| 7772 | (skip-unless (not (tramp--test-ksh-p))) | 7771 | (skip-unless (not (tramp--test-ksh-p))) |
| 7773 | (skip-unless (not (tramp--test-gdrive-p))) | 7772 | (skip-unless (not (tramp--test-gdrive-p))) |