1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Adapt tramp-tests.el according to Bug#30243

* test/lisp/net/tramp-tests.el (tramp--test-emacs27-p): New defun.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test21-file-links, tramp-test24-file-acl)
(tramp-test25-file-selinux, tramp--test-check-files): Use it.
This commit is contained in:
Michael Albinus 2018-02-01 15:49:18 +01:00
parent d42bd3a512
commit ccd4e4796c

View file

@ -2047,8 +2047,8 @@ This checks also `file-name-as-directory', `file-name-directory',
"Check `copy-file'."
(skip-unless (tramp--test-enabled))
;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p))
;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
'(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
@ -2158,8 +2158,8 @@ This checks also `file-name-as-directory', `file-name-directory',
"Check `rename-file'."
(skip-unless (tramp--test-enabled))
;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p))
;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
'(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
@ -3011,7 +3011,10 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; We must unquote it.
(should
(string-equal
(tramp-compat-file-name-unquote (file-truename tmp-name1))
(funcall
(if (tramp--test-emacs27-p)
'tramp-compat-file-name-unquote 'identity)
(file-truename tmp-name1))
(tramp-compat-file-name-unquote (file-truename tmp-name3))))))
;; Cleanup.
@ -3143,8 +3146,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(skip-unless (tramp--test-enabled))
(skip-unless (file-acl tramp-test-temporary-file-directory))
;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p))
;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
'(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
@ -3221,8 +3224,8 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(not (equal (file-selinux-context tramp-test-temporary-file-directory)
'(nil nil nil nil))))
;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p))
;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
'(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
@ -4216,6 +4219,12 @@ Some semantics has been changed for there, w/o new functions or
variables, so we check the Emacs version directly."
(>= emacs-major-version 26))
(defun tramp--test-emacs27-p ()
"Check for Emacs version >= 27.1.
Some semantics has been changed for there, w/o new functions or
variables, so we check the Emacs version directly."
(>= emacs-major-version 27))
(defun tramp--test-adb-p ()
"Check, whether the remote host runs Android.
This requires restrictions of file name syntax."
@ -4296,8 +4305,8 @@ This requires restrictions of file name syntax."
(defun tramp--test-check-files (&rest files)
"Run a simple but comprehensive test over every file in FILES."
;; `filename-non-special' has been fixed in Emacs 26.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs26-p))
;; `filename-non-special' has been fixed in Emacs 27.1, see Bug#29579.
(dolist (quoted (if (and tramp--test-expensive-test (tramp--test-emacs27-p))
'(nil t) '(nil)))
;; We must use `file-truename' for the temporary directory,
;; because it could be located on a symlinked directory. This