]> git.eshelyaron.com Git - emacs.git/commitdiff
; Make sure 'eshell-command' tests don't prompt the user
authorJim Porter <jporterbugs@gmail.com>
Sat, 1 Apr 2023 17:28:02 +0000 (10:28 -0700)
committerJim Porter <jporterbugs@gmail.com>
Sat, 1 Apr 2023 17:28:02 +0000 (10:28 -0700)
* test/lisp/eshell/eshell-tests.el
(eshell-test/eshell-command/background)
(eshell-test/eshell-command/background-pipeline): Wait for the process
to finish.

test/lisp/eshell/eshell-tests.el

index bf7ec0389f07f3a5e1c7def6b2573ba673210b53..fbff51a8873126333b9905fcee2b642e99c3c6aa 100644 (file)
@@ -136,6 +136,8 @@ This test uses a pipeline for the command."
       ;; buffer.
       (eshell-command "*echo hi &")
       (with-current-buffer "*Eshell Async Command Output*"
+        (while (get-buffer-process (current-buffer))
+          (accept-process-output))
         (goto-char (point-min))
         (should (looking-at "\\[echo\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]"))))))
 
@@ -149,6 +151,8 @@ This test uses a pipeline for the command."
       ;; XXX: As above, we can't write to the current buffer here.
       (eshell-command "*echo hi | *cat &")
       (with-current-buffer "*Eshell Async Command Output*"
+        (while (get-buffer-process (current-buffer))
+          (accept-process-output))
         (goto-char (point-min))
         (should (looking-at "\\[cat\\(\\.exe\\)?\\(<[0-9]+>\\)?\\]"))))))