diff options
| author | Michael Albinus | 2018-06-22 16:17:17 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-06-22 16:17:17 +0200 |
| commit | e6476c914ebd60971708e0ea0a292e1616d928fd (patch) | |
| tree | fa48d959e9bf5c5d25559654cd03736634603638 /test | |
| parent | 4e15d263134fdb8c9ff75e70f3f86225ad32ad31 (diff) | |
| download | emacs-e6476c914ebd60971708e0ea0a292e1616d928fd.tar.gz emacs-e6476c914ebd60971708e0ea0a292e1616d928fd.zip | |
Improve backward compatibility of Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-exec-path):
* lisp/net/tramp-sh.el (tramp-sh-handle-exec-path): Use ´file-remote-p'.
(tramp-get-ls-command-with): Handle busybox specially.
* test/lisp/net/tramp-tests.el (tramp-test34-exec-path): Check for
`fboundp'. Use `file-remote-p'. Hide compiler warning for older
Emacsen.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/net/tramp-tests.el | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index df07a8f1b89..f2d9b0ab47e 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el | |||
| @@ -4021,13 +4021,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4021 | (put 'explicit-shell-file-name 'permanent-local nil) | 4021 | (put 'explicit-shell-file-name 'permanent-local nil) |
| 4022 | (kill-buffer "*shell*")))) | 4022 | (kill-buffer "*shell*")))) |
| 4023 | 4023 | ||
| 4024 | ;; The function was introduced in Emacs 27.1. | 4024 | ;; `exec-path' was introduced in Emacs 27.1. `executable-find' has |
| 4025 | ;; changed the number of parameters, so we use `apply' for older | ||
| 4026 | ;; Emacsen. | ||
| 4025 | (ert-deftest tramp-test34-exec-path () | 4027 | (ert-deftest tramp-test34-exec-path () |
| 4026 | "Check `exec-path' and `executable-find'." | 4028 | "Check `exec-path' and `executable-find'." |
| 4027 | (skip-unless (tramp--test-enabled)) | 4029 | (skip-unless (tramp--test-enabled)) |
| 4028 | (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) | 4030 | (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p))) |
| 4029 | ;; Since Emacs 27.1. | 4031 | ;; Since Emacs 27.1. |
| 4030 | (skip-unless (boundp 'exec-path)) | 4032 | (skip-unless (fboundp 'exec-path)) |
| 4031 | 4033 | ||
| 4032 | (let ((tmp-name (tramp--test-make-temp-name)) | 4034 | (let ((tmp-name (tramp--test-make-temp-name)) |
| 4033 | (default-directory tramp-test-temporary-file-directory)) | 4035 | (default-directory tramp-test-temporary-file-directory)) |
| @@ -4038,9 +4040,9 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4038 | (should | 4040 | (should |
| 4039 | (string-equal | 4041 | (string-equal |
| 4040 | (car (last (with-no-warnings (exec-path)))) | 4042 | (car (last (with-no-warnings (exec-path)))) |
| 4041 | (file-local-name default-directory))) | 4043 | (file-remote-p default-directory 'localname))) |
| 4042 | ;; The shell "sh" shall always exist. | 4044 | ;; The shell "sh" shall always exist. |
| 4043 | (should (executable-find "sh" 'remote)) | 4045 | (should (apply 'executable-find '("sh" remote))) |
| 4044 | ;; Since the last element in `exec-path' is the current | 4046 | ;; Since the last element in `exec-path' is the current |
| 4045 | ;; directory, an executable file in that directory will be | 4047 | ;; directory, an executable file in that directory will be |
| 4046 | ;; found. | 4048 | ;; found. |
| @@ -4050,11 +4052,13 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." | |||
| 4050 | (should (file-executable-p tmp-name)) | 4052 | (should (file-executable-p tmp-name)) |
| 4051 | (should | 4053 | (should |
| 4052 | (string-equal | 4054 | (string-equal |
| 4053 | (executable-find (file-name-nondirectory tmp-name) 'remote) | 4055 | (apply |
| 4054 | (file-local-name tmp-name))) | 4056 | 'executable-find `(,(file-name-nondirectory tmp-name) remote)) |
| 4057 | (file-remote-p tmp-name 'localname))) | ||
| 4055 | (should-not | 4058 | (should-not |
| 4056 | (executable-find | 4059 | (apply |
| 4057 | (concat (file-name-nondirectory tmp-name) "foo") 'remote))) | 4060 | 'executable-find |
| 4061 | `(,(concat (file-name-nondirectory tmp-name) "foo") remote)))) | ||
| 4058 | 4062 | ||
| 4059 | ;; Cleanup. | 4063 | ;; Cleanup. |
| 4060 | (ignore-errors (delete-file tmp-name))))) | 4064 | (ignore-errors (delete-file tmp-name))))) |