]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt some Tramp tests
authorMichael Albinus <michael.albinus@gmx.de>
Sat, 12 Oct 2019 10:20:55 +0000 (12:20 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sat, 12 Oct 2019 10:20:55 +0000 (12:20 +0200)
* test/lisp/net/tramp-archive-tests.el
(tramp-archive-test17-insert-directory): Adapt regexp of summary line.

* test/lisp/net/tramp-tests.el (tramp-test21-file-links):
Extend test for symlinked directories.

test/lisp/net/tramp-archive-tests.el
test/lisp/net/tramp-tests.el

index 02fe8edf2714e584d5cd01fb4fa7de7fafcd5678..00d3b4a478afd20e4874ec58cdb1fb7b46b3c55c 100644 (file)
@@ -569,7 +569,7 @@ This checks also `file-name-as-directory', `file-name-directory',
             (looking-at-p
              (concat
               ;; There might be a summary line.
-              "\\(total.+[[:digit:]]+\n\\)?"
+              "\\(total.+[[:digit:]]+ ?[kKMGTPEZY]?i?B?\n\\)?"
               ;; We don't know in which order the files appear.
               (format
                "\\(.+ %s\\( ->.+\\)?\n\\)\\{%d\\}"
index ffaf8ef846bbbe3cd7b29288c485c065e98c8d4c..37021d6c93d18bb2cbc4fe5c1b7a81c1e809136f 100644 (file)
@@ -3265,7 +3265,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
           (tmp-name3 (tramp--test-make-temp-name 'local quoted))
           (tmp-name4 (tramp--test-make-temp-name nil quoted))
           (tmp-name5
-           (expand-file-name (file-name-nondirectory tmp-name1) tmp-name4)))
+           (expand-file-name (file-name-nondirectory tmp-name1) tmp-name4))
+          (tmp-name6 (tramp--test-make-temp-name nil quoted)))
       ;; Check `make-symbolic-link'.
       (unwind-protect
          (tramp--test-ignore-make-symbolic-link-error
@@ -3333,17 +3334,20 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
               (if quoted #'tramp-compat-file-name-unquote #'identity)
               (file-remote-p tmp-name1 'localname))
              (file-symlink-p tmp-name5)))
-           ;; `smbclient' does not show symlinks in directories, so
-           ;; we cannot delete a non-empty directory.  We delete the
-           ;; file explicitly.
-           (delete-file tmp-name5))
+           ;; Check, that files in symlinked directories still work.
+           (make-symbolic-link tmp-name4 tmp-name6)
+           (write-region "foo" nil (expand-file-name "foo" tmp-name6))
+           (delete-file (expand-file-name "foo" tmp-name6))
+           (should-not (file-exists-p (expand-file-name "foo" tmp-name4)))
+           (should-not (file-exists-p (expand-file-name "foo" tmp-name6))))
 
        ;; Cleanup.
-       (ignore-errors
-         (delete-file tmp-name1)
-         (delete-file tmp-name2)
-         (delete-file tmp-name3)
-         (delete-directory tmp-name4 'recursive)))
+       (ignore-errors (delete-file tmp-name1))
+       (ignore-errors (delete-file tmp-name2))
+       (ignore-errors (delete-file tmp-name3))
+       (ignore-errors (delete-file tmp-name5))
+       (ignore-errors (delete-file tmp-name6))
+       (ignore-errors (delete-directory tmp-name4 'recursive)))
 
       ;; Check `add-name-to-file'.
       (unwind-protect