diff options
Diffstat (limited to 'test/automated/tramp-tests.el')
-rw-r--r-- | test/automated/tramp-tests.el | 90 |
1 files changed, 57 insertions, 33 deletions
diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index e1039392ea..24cfa247c9 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -117,7 +117,9 @@ 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)) + (tramp-debug-on-error t) + (debug-ignored-errors + (cons "^make-symbolic-link not supported$" debug-ignored-errors))) (unwind-protect (progn ,@body) (when (> tramp-verbose 3) @@ -859,22 +861,20 @@ This checks also `file-name-as-directory', `file-name-directory', This tests also `file-directory-p' and `file-accessible-directory-p'." (skip-unless (tramp--test-enabled)) - (let ((tmp-name (tramp--test-make-temp-name))) + (let* ((tmp-name1 (tramp--test-make-temp-name)) + (tmp-name2 (expand-file-name "foo/bar" tmp-name1))) (unwind-protect (progn - (make-directory tmp-name) - (should (file-directory-p tmp-name)) - (should (file-accessible-directory-p tmp-name)) - (should-error - (make-directory (expand-file-name "foo/bar" tmp-name)) - :type 'file-error) - (make-directory (expand-file-name "foo/bar" tmp-name) 'parents) - (should (file-directory-p (expand-file-name "foo/bar" tmp-name))) - (should - (file-accessible-directory-p (expand-file-name "foo/bar" tmp-name)))) + (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) + (make-directory tmp-name2 'parents) + (should (file-directory-p tmp-name2)) + (should (file-accessible-directory-p tmp-name2))) ;; Cleanup. - (ignore-errors (delete-directory tmp-name 'recursive))))) + (ignore-errors (delete-directory tmp-name1 'recursive))))) (ert-deftest tramp-test14-delete-directory () "Check `delete-directory'." @@ -1667,17 +1667,28 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (defun tramp--test-adb-p () "Check, whether the remote host runs Android. This requires restrictions of file name syntax." - (eq (tramp-find-foreign-file-name-handler - tramp-test-temporary-file-directory) - 'tramp-adb-file-name-handler)) + (tramp-adb-file-name-p tramp-test-temporary-file-directory)) + +(defun tramp--test-ftp-p () + "Check, whether an FTP-like method is used. +This does not support globbing characters in file names (yet)." + ;; Globbing characters are ??, ?* and ?\[. + (and (eq (tramp-find-foreign-file-name-handler + tramp-test-temporary-file-directory) + 'tramp-sh-file-name-handler) + (string-match + "ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))) + +(defun tramp--test-gvfs-p () + "Check, whether the remote host runs a GVFS based method. +This requires restrictions of file name syntax." + (tramp-gvfs-file-name-p tramp-test-temporary-file-directory)) (defun tramp--test-smb-or-windows-nt-p () "Check, whether the locale or remote host runs MS Windows. This requires restrictions of file name syntax." (or (eq system-type 'windows-nt) - (eq (tramp-find-foreign-file-name-handler - tramp-test-temporary-file-directory) - 'tramp-smb-file-name-handler))) + (tramp-smb-file-name-p tramp-test-temporary-file-directory))) (defun tramp--test-check-files (&rest files) "Run a simple but comprehensive test over every file in FILES." @@ -1815,14 +1826,14 @@ This requires restrictions of file name syntax." (ignore-errors (delete-directory tmp-name2 'recursive))))) (defun tramp--test-special-characters () - "Perform the test in `tramp-test30-special-characters*'." + "Perform the test in `tramp-test31-special-characters*'." ;; Newlines, slashes and backslashes in file names are not ;; supported. So we don't test. And we don't test the tab ;; character on Windows or Cygwin, because the backslash is ;; interpreted as a path separator, preventing "\t" from being ;; expanded to <TAB>. (tramp--test-check-files - (if (tramp--test-smb-or-windows-nt-p) + (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p)) "foo bar baz" (if (or (tramp--test-adb-p) (eq system-type 'cygwin)) " foo bar baz " @@ -1831,15 +1842,28 @@ This requires restrictions of file name syntax." "-foo-bar-baz-" "%foo%bar%baz%" "&foo&bar&baz&" - (unless (tramp--test-smb-or-windows-nt-p) "?foo?bar?baz?") - (unless (tramp--test-smb-or-windows-nt-p) "*foo*bar*baz*") - (if (tramp--test-smb-or-windows-nt-p) "'foo'bar'baz'" "'foo\"bar'baz\"") + (unless (or (tramp--test-ftp-p) + (tramp--test-gvfs-p) + (tramp--test-smb-or-windows-nt-p)) + "?foo?bar?baz?") + (unless (or (tramp--test-ftp-p) + (tramp--test-gvfs-p) + (tramp--test-smb-or-windows-nt-p)) + "*foo*bar*baz*") + (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p)) + "'foo'bar'baz'" + "'foo\"bar'baz\"") "#foo~bar#baz~" - (if (tramp--test-smb-or-windows-nt-p) "!foo!bar!baz!" "!foo|bar!baz|") - (if (tramp--test-smb-or-windows-nt-p) ";foo;bar;baz;" ":foo;bar:baz;") - (unless (tramp--test-smb-or-windows-nt-p) "<foo>bar<baz>") + (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p)) + "!foo!bar!baz!" + "!foo|bar!baz|") + (if (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p)) + ";foo;bar;baz;" + ":foo;bar:baz;") + (unless (or (tramp--test-gvfs-p) (tramp--test-smb-or-windows-nt-p)) + "<foo>bar<baz>") "(foo)bar(baz)" - "[foo]bar[baz]" + (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p)) "[foo]bar[baz]") "{foo}bar{baz}")) ;; These tests are inspired by Bug#17238. @@ -1910,7 +1934,7 @@ Use the `ls' command." (tramp-set-connection-property v "perl" 'undef)))) (defun tramp--test-utf8 () - "Perform the test in `tramp-test31-utf8*'." + "Perform the test in `tramp-test32-utf8*'." (let ((coding-system-for-read 'utf-8) (coding-system-for-write 'utf-8) (file-name-coding-system 'utf-8)) @@ -2147,11 +2171,11 @@ Since it unloads Tramp, it shall be the last test to run." ;; doesn't work well when an interactive password must be provided. ;; * Fix `tramp-test27-start-file-process' for `nc' and on MS ;; Windows (`process-send-eof'?). -;; * Fix `tramp-test30-special-characters' for `nc'. -;; * Fix `tramp-test31-utf8' for `nc'/`telnet' (when target is a dumb +;; * Fix `tramp-test31-special-characters' for `nc'. +;; * Fix `tramp-test32-utf8' for `nc'/`telnet' (when target is a dumb ;; busybox). Seems to be in `directory-files'. -;; * Fix Bug#16928. Set expected error of `tramp-test32-asynchronous-requests'. -;; * Fix `tramp-test34-unload' (Not all symbols are unbound). Set +;; * Fix Bug#16928. Set expected error of `tramp-test33-asynchronous-requests'. +;; * Fix `tramp-test35-unload' (Not all symbols are unbound). Set ;; expected error. (defun tramp-test-all (&optional interactive) |