[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 15ed159 3/3: Adapt some Tramp tests
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] master 15ed159 3/3: Adapt some Tramp tests |
Date: |
Sat, 12 Oct 2019 06:21:04 -0400 (EDT) |
branch: master
commit 15ed1598b5e8aacea2825e6144cb3cce35101134
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
Adapt some Tramp tests
* 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 | 2 +-
test/lisp/net/tramp-tests.el | 24 ++++++++++++++----------
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/test/lisp/net/tramp-archive-tests.el
b/test/lisp/net/tramp-archive-tests.el
index 02fe8ed..00d3b4a 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -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\\}"
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index ffaf8ef..37021d6 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -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