diff options
| author | Michael Albinus | 2017-12-06 20:49:30 +0100 |
|---|---|---|
| committer | Michael Albinus | 2017-12-09 11:33:48 +0100 |
| commit | 9d9cbafce2d8ca00f61cc276d8a2a08c8211e82d (patch) | |
| tree | 83090cc3d9f1da817133c00f3e7cb00f6c87b046 /test | |
| parent | 01db80046f41c94569efd5dcdb11a1e46b3f16f3 (diff) | |
| download | emacs-9d9cbafce2d8ca00f61cc276d8a2a08c8211e82d.tar.gz emacs-9d9cbafce2d8ca00f61cc276d8a2a08c8211e82d.zip | |
Fix Bug#29579
* lisp/files.el (file-name-non-special):
Inhibit `file-name-handler-alist' only for some operations.
Add missing operations. (Bug#29579)
* lisp/net/tramp-compat.el (tramp-compat-file-name-quote):
Do not quote if it is quoted already.
* lisp/net/tramp-smb.el (tramp-smb-handle-insert-directory):
Use `copy-tree' but `copy-sequence'.
* lisp/net/tramp.el (tramp-handle-file-truename): Handle several
trailing slashes correctly.
* test/lisp/net/tramp-tests.el (tramp-test11-copy-file)
(tramp-test12-rename-file, tramp-test24-file-acl)
(tramp-test25-file-selinux, tramp--test-check-files):
Handle also quoted file names.
(tramp-test21-file-links): Fix file name quoting test.
(tramp-test24-file-acl): Be more robust for "smb" method.
(tramp-test35-make-auto-save-file-name): Enable hidden test cases.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 5699ab4b237..0d1e7d18d9b 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -1882,9 +1882,9 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 1882 | "Check `copy-file'." | 1882 | "Check `copy-file'." |
| 1883 | (skip-unless (tramp--test-enabled)) | 1883 | (skip-unless (tramp--test-enabled)) |
| 1884 | 1884 | ||
| 1885 | ;; TODO: The quoted case does not work. Copy local file to remote. | 1885 | ;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579. |
| 1886 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 1886 | (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p)) |
| 1887 | (let (quoted) | 1887 | '(nil t) '(nil))) |
| 1888 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | 1888 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 1889 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 1889 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 1890 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | 1890 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) |
| @@ -1984,9 +1984,9 @@ This checks also `file-name-as-directory', `file-name-directory', | |||
| 1984 | "Check `rename-file'." | 1984 | "Check `rename-file'." |
| 1985 | (skip-unless (tramp--test-enabled)) | 1985 | (skip-unless (tramp--test-enabled)) |
| 1986 | 1986 | ||
| 1987 | ;; TODO: The quoted case does not work. | 1987 | ;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579. |
| 1988 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 1988 | (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p)) |
| 1989 | (let (quoted) | 1989 | '(nil t) '(nil))) |
| 1990 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | 1990 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 1991 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 1991 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 1992 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | 1992 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) |
| @@ -2825,7 +2825,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2825 | ;; We must unquote it. | 2825 | ;; We must unquote it. |
| 2826 | (should | 2826 | (should |
| 2827 | (string-equal | 2827 | (string-equal |
| 2828 | (file-truename tmp-name1) | 2828 | (tramp-compat-file-name-unquote (file-truename tmp-name1)) |
| 2829 | (tramp-compat-file-name-unquote (file-truename tmp-name3))))) | 2829 | (tramp-compat-file-name-unquote (file-truename tmp-name3))))) |
| 2830 | 2830 | ||
| 2831 | ;; Cleanup. | 2831 | ;; Cleanup. |
| @@ -2951,9 +2951,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2951 | (skip-unless (tramp--test-enabled)) | 2951 | (skip-unless (tramp--test-enabled)) |
| 2952 | (skip-unless (file-acl tramp-test-temporary-file-directory)) | 2952 | (skip-unless (file-acl tramp-test-temporary-file-directory)) |
| 2953 | 2953 | ||
| 2954 | ;; TODO: The quoted case does not work. Copy local file to remote. | 2954 | ;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579. |
| 2955 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 2955 | (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p)) |
| 2956 | (let (quoted) | 2956 | '(nil t) '(nil))) |
| 2957 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | 2957 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 2958 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 2958 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 2959 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | 2959 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) |
| @@ -2968,13 +2968,14 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 2968 | (should (file-acl tmp-name2)) | 2968 | (should (file-acl tmp-name2)) |
| 2969 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | 2969 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) |
| 2970 | ;; Different permissions mean different ACLs. | 2970 | ;; Different permissions mean different ACLs. |
| 2971 | (set-file-modes tmp-name1 #o777) | 2971 | (when (not (tramp--test-windows-nt-or-smb-p)) |
| 2972 | (set-file-modes tmp-name2 #o444) | 2972 | (set-file-modes tmp-name1 #o777) |
| 2973 | (should-not | 2973 | (set-file-modes tmp-name2 #o444) |
| 2974 | (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | 2974 | (should-not |
| 2975 | ;; Copy ACL. | 2975 | (string-equal (file-acl tmp-name1) (file-acl tmp-name2)))) |
| 2976 | (should (set-file-acl tmp-name2 (file-acl tmp-name1))) | 2976 | ;; Copy ACL. Not all remote handlers support it, so we test. |
| 2977 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2))) | 2977 | (when (set-file-acl tmp-name2 (file-acl tmp-name1)) |
| 2978 | (should (string-equal (file-acl tmp-name1) (file-acl tmp-name2)))) | ||
| 2978 | ;; An invalid ACL does not harm. | 2979 | ;; An invalid ACL does not harm. |
| 2979 | (should-not (set-file-acl tmp-name2 "foo"))) | 2980 | (should-not (set-file-acl tmp-name2 "foo"))) |
| 2980 | 2981 | ||
| @@ -3028,9 +3029,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3028 | (not (equal (file-selinux-context tramp-test-temporary-file-directory) | 3029 | (not (equal (file-selinux-context tramp-test-temporary-file-directory) |
| 3029 | '(nil nil nil nil)))) | 3030 | '(nil nil nil nil)))) |
| 3030 | 3031 | ||
| 3031 | ;; TODO: The quoted case does not work. Copy local file to remote. | 3032 | ;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579. |
| 3032 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 3033 | (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p)) |
| 3033 | (let (quoted) | 3034 | '(nil t) '(nil))) |
| 3034 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) | 3035 | (let ((tmp-name1 (tramp--test-make-temp-name nil quoted)) |
| 3035 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) | 3036 | (tmp-name2 (tramp--test-make-temp-name nil quoted)) |
| 3036 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) | 3037 | (tmp-name3 (tramp--test-make-temp-name 'local quoted))) |
| @@ -3823,8 +3824,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3823 | (format "#%s#" (file-name-nondirectory tmp-name1)) | 3824 | (format "#%s#" (file-name-nondirectory tmp-name1)) |
| 3824 | tramp-test-temporary-file-directory)))))) | 3825 | tramp-test-temporary-file-directory)))))) |
| 3825 | 3826 | ||
| 3826 | ;; TODO: The following two cases don't work yet. | ||
| 3827 | (when nil | ||
| 3828 | ;; Use default `tramp-auto-save-directory' mechanism. | 3827 | ;; Use default `tramp-auto-save-directory' mechanism. |
| 3829 | (let ((tramp-auto-save-directory tmp-name2)) | 3828 | (let ((tramp-auto-save-directory tmp-name2)) |
| 3830 | (with-temp-buffer | 3829 | (with-temp-buffer |
| @@ -3869,7 +3868,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 3869 | (tramp-compat-file-name-unquote tmp-name1))) | 3868 | (tramp-compat-file-name-unquote tmp-name1))) |
| 3870 | tmp-name2))) | 3869 | tmp-name2))) |
| 3871 | (should (file-directory-p tmp-name2))))) | 3870 | (should (file-directory-p tmp-name2))))) |
| 3872 | ) ;; TODO | ||
| 3873 | 3871 | ||
| 3874 | ;; Cleanup. | 3872 | ;; Cleanup. |
| 3875 | (ignore-errors (delete-file tmp-name1)) | 3873 | (ignore-errors (delete-file tmp-name1)) |
| @@ -4084,9 +4082,9 @@ This requires restrictions of file name syntax." | |||
| 4084 | 4082 | ||
| 4085 | (defun tramp--test-check-files (&rest files) | 4083 | (defun tramp--test-check-files (&rest files) |
| 4086 | "Run a simple but comprehensive test over every file in FILES." | 4084 | "Run a simple but comprehensive test over every file in FILES." |
| 4087 | ;; TODO: The quoted case does not work. | 4085 | ;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579. |
| 4088 | ;;(dolist (quoted (if tramp--test-expensive-test '(nil t) '(nil))) | 4086 | (dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p)) |
| 4089 | (let (quoted) | 4087 | '(nil t) '(nil))) |
| 4090 | ;; We must use `file-truename' for the temporary directory, | 4088 | ;; We must use `file-truename' for the temporary directory, |
| 4091 | ;; because it could be located on a symlinked directory. This | 4089 | ;; because it could be located on a symlinked directory. This |
| 4092 | ;; would let the test fail. | 4090 | ;; would let the test fail. |