emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 751d592 2/3: Some minor tweaks in tramp-tests.el


From: Michael Albinus
Subject: [Emacs-diffs] master 751d592 2/3: Some minor tweaks in tramp-tests.el
Date: Mon, 5 Jun 2017 07:00:25 -0400 (EDT)

branch: master
commit 751d5920bed1a3af01fd5a31ce4eb7d8b6994151
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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.
---
 test/lisp/net/tramp-tests.el | 34 ++++++++++++++++++----------------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 8c97faf..6876f20 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]