diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-archive-resources/foo.tar.gz | bin | 234 -> 274 bytes | |||
| -rw-r--r-- | test/lisp/net/tramp-archive-tests.el | 32 |
2 files changed, 18 insertions, 14 deletions
diff --git a/test/lisp/net/tramp-archive-resources/foo.tar.gz b/test/lisp/net/tramp-archive-resources/foo.tar.gz index 68925b147fc..0d2e9878dd7 100644 --- a/test/lisp/net/tramp-archive-resources/foo.tar.gz +++ b/test/lisp/net/tramp-archive-resources/foo.tar.gz | |||
| Binary files differ | |||
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el index 149ed370432..82dd5de8b9a 100644 --- a/test/lisp/net/tramp-archive-tests.el +++ b/test/lisp/net/tramp-archive-tests.el | |||
| @@ -99,9 +99,9 @@ variables, so we check the Emacs version directly." | |||
| 99 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo/bar"))) | 99 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo/bar"))) |
| 100 | ;; A file archive inside a file archive. | 100 | ;; A file archive inside a file archive. |
| 101 | (should | 101 | (should |
| 102 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo.tar"))) | 102 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "baz.tar"))) |
| 103 | (should | 103 | (should |
| 104 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "foo.tar/")))) | 104 | (tramp-archive-file-name-p (concat tramp-archive-test-archive "baz.tar/")))) |
| 105 | 105 | ||
| 106 | (ert-deftest tramp-archive-test02-file-name-dissect () | 106 | (ert-deftest tramp-archive-test02-file-name-dissect () |
| 107 | "Check archive file name components." | 107 | "Check archive file name components." |
| @@ -145,13 +145,14 @@ variables, so we check the Emacs version directly." | |||
| 145 | 145 | ||
| 146 | ;; File archive in file archive. | 146 | ;; File archive in file archive. |
| 147 | (let* ((tramp-archive-test-file-archive | 147 | (let* ((tramp-archive-test-file-archive |
| 148 | (concat tramp-archive-test-archive "bar.tar")) | 148 | (concat tramp-archive-test-archive "baz.tar")) |
| 149 | (tramp-archive-test-archive | 149 | (tramp-archive-test-archive |
| 150 | (file-name-as-directory tramp-archive-test-file-archive)) | 150 | (file-name-as-directory tramp-archive-test-file-archive)) |
| 151 | (tramp-methods (cons `(,tramp-archive-method) tramp-methods)) | 151 | (tramp-methods (cons `(,tramp-archive-method) tramp-methods)) |
| 152 | (tramp-gvfs-methods tramp-archive-all-gvfs-methods)) | 152 | (tramp-gvfs-methods tramp-archive-all-gvfs-methods)) |
| 153 | (unwind-protect | 153 | (unwind-protect |
| 154 | (with-parsed-tramp-archive-file-name tramp-archive-test-archive nil | 154 | (with-parsed-tramp-archive-file-name |
| 155 | (expand-file-name "bar" tramp-archive-test-archive) nil | ||
| 155 | (should (string-equal method tramp-archive-method)) | 156 | (should (string-equal method tramp-archive-method)) |
| 156 | (should-not user) | 157 | (should-not user) |
| 157 | (should-not domain) | 158 | (should-not domain) |
| @@ -184,8 +185,12 @@ variables, so we check the Emacs version directly." | |||
| 184 | nil "/")) | 185 | nil "/")) |
| 185 | (file-name-nondirectory tramp-archive-test-file-archive))))) | 186 | (file-name-nondirectory tramp-archive-test-file-archive))))) |
| 186 | (should-not port) | 187 | (should-not port) |
| 187 | (should (string-equal localname "/")) | 188 | (should (string-equal localname "/bar")) |
| 188 | (should (string-equal archive tramp-archive-test-file-archive))) | 189 | ;; The `archive' component is now already a Tramp file name. |
| 190 | (should | ||
| 191 | (string-equal | ||
| 192 | archive | ||
| 193 | (tramp-archive-gvfs-file-name tramp-archive-test-file-archive)))) | ||
| 189 | 194 | ||
| 190 | ;; Cleanup. | 195 | ;; Cleanup. |
| 191 | (tramp-archive-cleanup-hash)))) | 196 | (tramp-archive-cleanup-hash)))) |
| @@ -290,9 +295,8 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 290 | :type tramp-file-missing)) | 295 | :type tramp-file-missing)) |
| 291 | 296 | ||
| 292 | ;; Cleanup. | 297 | ;; Cleanup. |
| 293 | (ignore-errors | 298 | (ignore-errors (tramp-archive--test-delete tmp-name)) |
| 294 | (tramp-archive--test-delete tmp-name) | 299 | (tramp-archive-cleanup-hash)))) |
| 295 | (tramp-archive-cleanup-hash))))) | ||
| 296 | 300 | ||
| 297 | (ert-deftest tramp-archive-test09-insert-file-contents () | 301 | (ert-deftest tramp-archive-test09-insert-file-contents () |
| 298 | "Check `insert-file-contents'." | 302 | "Check `insert-file-contents'." |
| @@ -444,7 +448,7 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 444 | (skip-unless tramp-gvfs-enabled) | 448 | (skip-unless tramp-gvfs-enabled) |
| 445 | 449 | ||
| 446 | (let ((tmp-name tramp-archive-test-archive) | 450 | (let ((tmp-name tramp-archive-test-archive) |
| 447 | (files '("." ".." "bar" "foo.hrd" "foo.lnk" "foo.txt"))) | 451 | (files '("." ".." "bar" "baz.tar" "foo.hrd" "foo.lnk" "foo.txt"))) |
| 448 | (unwind-protect | 452 | (unwind-protect |
| 449 | (progn | 453 | (progn |
| 450 | (should (file-directory-p tmp-name)) | 454 | (should (file-directory-p tmp-name)) |
| @@ -656,7 +660,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 656 | ;; Local files. | 660 | ;; Local files. |
| 657 | (should (equal (file-name-completion "fo" tmp-name) "foo.")) | 661 | (should (equal (file-name-completion "fo" tmp-name) "foo.")) |
| 658 | (should (equal (file-name-completion "foo.txt" tmp-name) t)) | 662 | (should (equal (file-name-completion "foo.txt" tmp-name) t)) |
| 659 | (should (equal (file-name-completion "b" tmp-name) "bar/")) | 663 | (should (equal (file-name-completion "b" tmp-name) "ba")) |
| 660 | (should-not (file-name-completion "a" tmp-name)) | 664 | (should-not (file-name-completion "a" tmp-name)) |
| 661 | (should | 665 | (should |
| 662 | (equal | 666 | (equal |
| @@ -668,18 +672,18 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'." | |||
| 668 | (should | 672 | (should |
| 669 | (equal | 673 | (equal |
| 670 | (sort (file-name-all-completions "b" tmp-name) 'string-lessp) | 674 | (sort (file-name-all-completions "b" tmp-name) 'string-lessp) |
| 671 | '("bar/"))) | 675 | '("bar/" "baz.tar"))) |
| 672 | (should-not (file-name-all-completions "a" tmp-name)) | 676 | (should-not (file-name-all-completions "a" tmp-name)) |
| 673 | ;; `completion-regexp-list' restricts the completion to | 677 | ;; `completion-regexp-list' restricts the completion to |
| 674 | ;; files which match all expressions in this list. | 678 | ;; files which match all expressions in this list. |
| 675 | (let ((completion-regexp-list | 679 | (let ((completion-regexp-list |
| 676 | `(,directory-files-no-dot-files-regexp "b"))) | 680 | `(,directory-files-no-dot-files-regexp "b"))) |
| 677 | (should | 681 | (should |
| 678 | (equal (file-name-completion "" tmp-name) "bar/")) | 682 | (equal (file-name-completion "" tmp-name) "ba")) |
| 679 | (should | 683 | (should |
| 680 | (equal | 684 | (equal |
| 681 | (sort (file-name-all-completions "" tmp-name) 'string-lessp) | 685 | (sort (file-name-all-completions "" tmp-name) 'string-lessp) |
| 682 | '("bar/"))))) | 686 | '("bar/" "baz.tar"))))) |
| 683 | 687 | ||
| 684 | ;; Cleanup. | 688 | ;; Cleanup. |
| 685 | (tramp-archive-cleanup-hash)))) | 689 | (tramp-archive-cleanup-hash)))) |