summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-01-27 23:13:36 -0800
committerLars Ingebrigtsen <larsi@gnus.org>2022-02-03 20:02:20 +0100
commit2e60ef696a3cf16b0eb297948e27ba0cb32a125e (patch)
treebec32b4c1c5b76e65272d22c4c1e49312e0aae79 /test/lisp/eshell/eshell-tests.el
parentdcc97fec29785051d7d11a66beb5f44fbaae6289 (diff)
downloademacs-2e60ef696a3cf16b0eb297948e27ba0cb32a125e.tar.gz
Ensure that tailproc is set for the last process in an Eshell pipeline
In particular, this used to fail for pipelines where the last process in the pipeline came from the first element of the pipeline. This could happen when a process was piped to an ordinary Lisp function, like in '*echo hi | echo bye'. * lisp/eshell/esh-cmd.el (eshell-do-pipelines): Set the tailproc even for the first process in the pipeline. * test/lisp/eshell/eshell-tests.el (eshell-test/pipe-tailproc): New test.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r--test/lisp/eshell/eshell-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 542815df809..7658d5f5517 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -129,6 +129,13 @@ e.g. \"{(+ 1 2)} 3\" => 3"
(eshell-command-result-p "echo ${echo hi}-${*echo there}"
"hi-there\n")))
+(ert-deftest eshell-test/pipe-tailproc ()
+ "Check that piping a process to a non-process command waits for the process"
+ (skip-unless (executable-find "echo"))
+ (with-temp-eshell
+ (eshell-command-result-p "*echo hi | echo bye"
+ "bye\nhi\n")))
+
(ert-deftest eshell-test/window-height ()
"$LINES should equal (window-height)"
(should (eshell-test-command-result "= $LINES (window-height)")))