emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ff630b5 3/3: Adapt tramp-test32-shell-command


From: Michael Albinus
Subject: master ff630b5 3/3: Adapt tramp-test32-shell-command
Date: Fri, 24 Jan 2020 08:42:34 -0500 (EST)

branch: master
commit ff630b56939541752097e5cc87c3db1de68d4c5f
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    Adapt tramp-test32-shell-command
    
    * test/lisp/net/tramp-tests.el (tramp-test32-shell-command):
    Test error buffer for synchronous `shell-command' only.
---
 test/lisp/net/tramp-tests.el | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 247f878..1296528 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -4492,25 +4492,20 @@ INPUT, if non-nil, is a string sent to the process."
                (buffer-string))))
 
          ;; Cleanup.
-         (ignore-errors (delete-file tmp-name)))
+         (ignore-errors (delete-file tmp-name))))
 
-       ;; Test `{async-}shell-command' with error buffer.
-       (let ((stderr (generate-new-buffer "*stderr*")))
-         (unwind-protect
-             (with-temp-buffer
-               (funcall
-                this-shell-command "cat /; sleep 1" (current-buffer) stderr)
-               ;; Check stderr.
-               (when (eq this-shell-command #'tramp--test-async-shell-command)
-                 (ignore-errors
-                   (delete-process (get-buffer-process (current-buffer)))))
-               (should (zerop (buffer-size)))
-               (with-current-buffer stderr
-                 (should
-                  (string-match "cat:.* Is a directory" (buffer-string)))))
+      ;; Test `shell-command' with error buffer.
+      (let ((stderr (generate-new-buffer "*stderr*")))
+       (unwind-protect
+           (with-temp-buffer
+             (shell-command "echo foo; echo bar >&2" (current-buffer) stderr)
+             (should (string-equal "foo\n" (buffer-string)))
+             ;; Check stderr.
+             (with-current-buffer stderr
+               (should (string-equal "bar\n" (buffer-string)))))
 
-           ;; Cleanup.
-           (ignore-errors (kill-buffer stderr)))))
+         ;; Cleanup.
+         (ignore-errors (kill-buffer stderr))))
 
       ;; Test sending string to `async-shell-command'.
       (unwind-protect



reply via email to

[Prev in Thread] Current Thread [Next in Thread]