Skip to content

Commit ff630b5

Browse files
committed
Adapt tramp-test32-shell-command
* test/lisp/net/tramp-tests.el (tramp-test32-shell-command): Test error buffer for synchronous `shell-command' only.
1 parent 0debadb commit ff630b5

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

test/lisp/net/tramp-tests.el

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4492,25 +4492,20 @@ INPUT, if non-nil, is a string sent to the process."
44924492
(buffer-string))))
44934493

44944494
;; Cleanup.
4495-
(ignore-errors (delete-file tmp-name)))
4495+
(ignore-errors (delete-file tmp-name))))
44964496

4497-
;; Test `{async-}shell-command' with error buffer.
4498-
(let ((stderr (generate-new-buffer "*stderr*")))
4499-
(unwind-protect
4500-
(with-temp-buffer
4501-
(funcall
4502-
this-shell-command "cat /; sleep 1" (current-buffer) stderr)
4503-
;; Check stderr.
4504-
(when (eq this-shell-command #'tramp--test-async-shell-command)
4505-
(ignore-errors
4506-
(delete-process (get-buffer-process (current-buffer)))))
4507-
(should (zerop (buffer-size)))
4508-
(with-current-buffer stderr
4509-
(should
4510-
(string-match "cat:.* Is a directory" (buffer-string)))))
4497+
;; Test `shell-command' with error buffer.
4498+
(let ((stderr (generate-new-buffer "*stderr*")))
4499+
(unwind-protect
4500+
(with-temp-buffer
4501+
(shell-command "echo foo; echo bar >&2" (current-buffer) stderr)
4502+
(should (string-equal "foo\n" (buffer-string)))
4503+
;; Check stderr.
4504+
(with-current-buffer stderr
4505+
(should (string-equal "bar\n" (buffer-string)))))
45114506

4512-
;; Cleanup.
4513-
(ignore-errors (kill-buffer stderr)))))
4507+
;; Cleanup.
4508+
(ignore-errors (kill-buffer stderr))))
45144509

45154510
;; Test sending string to `async-shell-command'.
45164511
(unwind-protect

0 commit comments

Comments
 (0)