Commit 751d5920 authored by Michael Albinus's avatar Michael Albinus
Browse files

Some minor tweaks in tramp-tests.el

* test/lisp/net/tramp-tests.el (tramp-test05-expand-file-name-relative):
Let it pass for all gfvs based methods.
(tramp-test24-file-name-completion): Run method and host
completion for all syntaxes only when expensive tests are enabled.
Do not check host completion for gvfs based methods.
(tramp--test-gvfs-p): Add optional METHOD argument.
(tramp--test-afp-or-smb-p): Remove.
parent 792de924
......@@ -1625,8 +1625,9 @@ handled properly. BODY shall not contain a timeout."
;; Mark as failed until bug has been fixed.
:expected-result :failed
(skip-unless (tramp--test-enabled))
;; File names with a share behave differently.
(when (or (tramp--test-adb-p) (tramp--test-afp-or-smb-p))
;; These are the methods the test doesn't fail.
(when (or (tramp--test-adb-p) (tramp--test-gvfs-p)
(tramp-smb-file-name-p tramp-test-temporary-file-directory))
(setf (ert-test-expected-result-type
(ert-get-test 'tramp-test05-expand-file-name-relative))
:passed))
......@@ -2502,7 +2503,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(orig-syntax tramp-syntax))
(unwind-protect
(dolist (syntax (tramp-syntax-values))
(dolist
(syntax
(if tramp--test-expensive-test
(tramp-syntax-values) `(,orig-syntax)))
(tramp-change-syntax syntax)
(let ;; This is needed for the `simplified' syntax.
((method-marker
......@@ -2518,9 +2522,12 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(concat prefix-format method (tramp-postfix-method-format))
(file-name-all-completions
(concat prefix-format (substring method 0 1)) "/"))))
;; Complete host name for default method.
(unless (zerop (length host))
(let ((tramp-default-method (or method tramp-default-method)))
;; Complete host name for default method. With gvfs
;; based methods, host name will be determined as
;; host.local, so we omit the test.
(let ((tramp-default-method (or method tramp-default-method)))
(unless (or (zerop (length host))
(tramp--test-gvfs-p tramp-default-method))
(should
(member
(concat
......@@ -2534,7 +2541,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; Complete host name.
(unless (or (zerop (length method))
(zerop (length (tramp-method-regexp)))
(zerop (length host)))
(zerop (length host))
(tramp--test-gvfs-p method))
(should
(member
(concat
......@@ -3224,10 +3232,11 @@ This does not support globbing characters in file names (yet)."
(string-match
"ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))
(defun tramp--test-gvfs-p ()
(defun tramp--test-gvfs-p (&optional method)
"Check, whether the remote host runs a GVFS based method.
This requires restrictions of file name syntax."
(tramp-gvfs-file-name-p tramp-test-temporary-file-directory))
(or (member method tramp-gvfs-methods)
(tramp-gvfs-file-name-p tramp-test-temporary-file-directory)))
(defun tramp--test-hpux-p ()
"Check, whether the remote host runs HP-UX.
......@@ -3268,13 +3277,6 @@ This requires restrictions of file name syntax."
(or (eq system-type 'windows-nt)
(tramp-smb-file-name-p tramp-test-temporary-file-directory)))
(defun tramp--test-afp-or-smb-p ()
"Check, whether the afp or smb method is used.
This requires an additional share name."
(or (string-equal
"afp" (file-remote-p tramp-test-temporary-file-directory 'method))
(tramp-smb-file-name-p tramp-test-temporary-file-directory)))
(defun tramp--test-check-files (&rest files)
"Run a simple but comprehensive test over every file in FILES."
;; TODO: The quoted case does not work.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment