summaryrefslogtreecommitdiff
path: root/test/lisp
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-12-29 13:53:06 +0100
committerMichael Albinus <michael.albinus@gmx.de>2019-12-30 18:55:39 +0100
commit248c5e103d61af4352e2c8d9b810babdd4cd6ddf (patch)
tree46d9a74882b02f3069888eff457535db4cd64696 /test/lisp
parent90083b7d78df1b8a054f3028cc9eb8c55a632b1e (diff)
downloademacs-248c5e103d61af4352e2c8d9b810babdd4cd6ddf.tar.gz
Sync with Tramp 2.4.3
* doc/misc/trampver.texi: * lisp/net/trampver.el: Change version to "2.4.3". * lisp/net/tramp.el: Bump version. (tramp-handle-shell-command): The temp file for error-buffer is remote. * test/lisp/net/tramp-tests.el (tramp-test30-make-process): Simplify buffer generation. (tramp-test32-shell-command): Extend test. (cherry picked from commit d6922db49dea33ac2bca8b33d24763cc7b2e4cd7)
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/net/tramp-tests.el34
1 files changed, 20 insertions, 14 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 77b3ea0ad21..cb52d40f8be 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -2902,8 +2902,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
(sort (copy-sequence `(,tmp-name3 ,tmp-name4)) 'string<))))
;; Cleanup.
- (ignore-errors
- (delete-directory tmp-name1 'recursive))))))
+ (ignore-errors (delete-directory tmp-name1 'recursive))))))
(ert-deftest tramp-test17-insert-directory ()
"Check `insert-directory'."
@@ -4354,8 +4353,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; Process with stderr. tramp-adb.el doesn't support it (yet).
(unless (tramp--test-adb-p)
- (let ((stderr
- (generate-new-buffer (generate-new-buffer-name "stderr"))))
+ (let ((stderr (generate-new-buffer "*stderr*")))
(unwind-protect
(with-temp-buffer
(setq proc
@@ -4458,6 +4456,20 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
;; Cleanup.
(ignore-errors (delete-file tmp-name)))
+ ;; Test `shell-command' with error buffer.
+ (let ((stderr (generate-new-buffer "*stderr*")))
+ (unwind-protect
+ (with-temp-buffer
+ (shell-command "error" (current-buffer) stderr)
+ (should (= (point-min) (point-max)))
+ (should
+ (string-match
+ "error:.+not found"
+ (with-current-buffer stderr (buffer-string)))))
+
+ ;; Cleanup.
+ (ignore-errors (kill-buffer stderr))))
+
;; Test ordinary `async-shell-command'.
(unwind-protect
(with-temp-buffer
@@ -4475,10 +4487,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(while
(re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
- ;; There might be a nasty "Process *Async Shell* finished" message.
- (goto-char (point-min))
- (forward-line)
- (narrow-to-region (point-min) (point))
(should
(string-equal
(format "%s\n" (file-name-nondirectory tmp-name))
@@ -4505,13 +4513,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(while
(re-search-forward tramp-display-escape-sequence-regexp nil t)
(replace-match "" nil nil))
- ;; There might be a nasty "Process *Async Shell* finished" message.
- (goto-char (point-min))
- (forward-line)
- (narrow-to-region (point-min) (point))
+ ;; We cannot use `string-equal', because tramp-adb.el
+ ;; echoes also the sent string.
(should
- (string-equal
- (format "%s\n" (file-name-nondirectory tmp-name))
+ (string-match
+ (format "\\`%s" (regexp-quote (file-name-nondirectory tmp-name)))
(buffer-string))))
;; Cleanup.