]> code.delx.au - gnu-emacs/blobdiff - test/lisp/net/tramp-tests.el
Avoid recursive detection of remote uid and gid in tramp-gvfs.el
[gnu-emacs] / test / lisp / net / tramp-tests.el
index b9562c1befc7b0ed6edf2dafa177864e5e9c77a7..a1ae78ab5c3ff4f807021a85314a5c93f61b49c9 100644 (file)
@@ -115,11 +115,10 @@ being the result.")
 (defmacro tramp--instrument-test-case (verbose &rest body)
   "Run BODY with `tramp-verbose' equal VERBOSE.
 Print the the content of the Tramp debug buffer, if BODY does not
-eval properly in `should', `should-not' or `should-error'.  BODY
-shall not contain a timeout."
+eval properly in `should' or `should-not'.  `should-error' is not
+handled properly.  BODY shall not contain a timeout."
   (declare (indent 1) (debug (natnump body)))
   `(let ((tramp-verbose ,verbose)
-        (tramp-message-show-message t)
         (tramp-debug-on-error t)
         (debug-ignored-errors
          (cons "^make-symbolic-link not supported$" debug-ignored-errors)))
@@ -932,7 +931,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
          (make-directory tmp-name1)
          (should (file-directory-p tmp-name1))
          (should (file-accessible-directory-p tmp-name1))
-         (should-error (make-directory tmp-name2) :type 'file-error)
+         (should-error (make-directory tmp-name2))
          (make-directory tmp-name2 'parents)
          (should (file-directory-p tmp-name2))
          (should (file-accessible-directory-p tmp-name2)))
@@ -952,8 +951,10 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
     (should-not (file-directory-p tmp-name))
     ;; Delete non-empty directory.
     (make-directory tmp-name)
+    (should (file-directory-p tmp-name))
     (write-region "foo" nil (expand-file-name "bla" tmp-name))
-    (should-error (delete-directory tmp-name) :type 'file-error)
+    (should (file-exists-p (expand-file-name "bla" tmp-name)))
+    (should-error (delete-directory tmp-name))
     (delete-directory tmp-name 'recursive)
     (should-not (file-directory-p tmp-name))))
 
@@ -1112,12 +1113,12 @@ This tests also `file-readable-p' and `file-regular-p'."
        (progn
          (write-region "foo" nil tmp-name1)
          (should (file-exists-p tmp-name1))
-         (setq attr (file-attributes tmp-name1))
-         (should (consp attr))
-         (should (file-exists-p tmp-name1))
          (should (file-readable-p tmp-name1))
          (should (file-regular-p tmp-name1))
+
          ;; We do not test inodes and device numbers.
+         (setq attr (file-attributes tmp-name1))
+         (should (consp attr))
          (should (null (car attr)))
           (should (numberp (nth 1 attr))) ;; Link.
           (should (numberp (nth 2 attr))) ;; Uid.