diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-02-04 22:41:39 -0800 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-02-05 07:58:59 +0100 |
commit | 785a045b868e0aeef08858e86a9efe48311e8f48 (patch) | |
tree | 2b87eab3110904dad4c8f6d139d1d5084bdfabd7 /test/lisp/eshell/eshell-tests.el | |
parent | a8de2e20e093bb45231327e824ceb8421993634e (diff) | |
download | emacs-785a045b868e0aeef08858e86a9efe48311e8f48.tar.gz |
Ensure that the CAR of 'eshell-last-async-procs' always points to a process
Previously, if a non-process was piped to a process, this could end up
being nil, which isn't correct. 'eshell-last-async-procs' should just
ignore non-process commands in a pipeline.
* lisp/eshell/esh-cmd.el (eshell-do-pipelines): Set 'headproc'
correctly.
* test/lisp/eshell/eshell-tests.el (eshell-test/pipe-headproc): New test.
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r-- | test/lisp/eshell/eshell-tests.el | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el index c5ca0a54852..d6ee1bdb175 100644 --- a/test/lisp/eshell/eshell-tests.el +++ b/test/lisp/eshell/eshell-tests.el @@ -123,6 +123,13 @@ e.g. \"{(+ 1 2)} 3\" => 3" (eshell-command-result-p "echo ${echo hi}-${*echo there}" "hi-there\n"))) +(ert-deftest eshell-test/pipe-headproc () + "Check that piping a non-process to a process command waits for the process" + (skip-unless (executable-find "cat")) + (with-temp-eshell + (eshell-command-result-p "echo hi | *cat" + "hi"))) + (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")) |