1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-02 08:22:22 +00:00

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.
This commit is contained in:
Michael Albinus 2019-10-12 12:20:55 +02:00
parent 251c215f65
commit 15ed1598b5
2 changed files with 15 additions and 11 deletions

View 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\\}"

View 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