summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-05-22 17:27:48 -0700
committerLars Ingebrigtsen <larsi@gnus.org>2022-05-24 14:58:00 +0200
commita49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d (patch)
treed8ac3f279ad977d2ae21f42d27a389b6b53ecddd /test/lisp/eshell/eshell-tests.el
parentbe17333acee2086d1c729197dfe64432f6ad6625 (diff)
downloademacs-a49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d.tar.gz
Keep subcommands in pipelines from clobbering the head/tail processes
* lisp/eshell/esh-cmd.el (eshell-execute-pipeline): Use 'make-symbol' for headproc and tailproc. (eshell-do-pipelines, eshell-do-pipelines-synchronously): Adapt to the above. * test/lisp/eshell/eshell-tests.el (eshell-test/pipe-subcommand) (eshell-test/pipe-subcommand-with-pipe): New test. * doc/misc/eshell.texi (Bugs and ideas): Remove item about piping to process from loop; this commit fixes it (bug#55590).
Diffstat (limited to 'test/lisp/eshell/eshell-tests.el')
-rw-r--r--test/lisp/eshell/eshell-tests.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 7cdeb017e44..c0affed80aa 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -114,6 +114,22 @@ e.g. \"{(+ 1 2)} 3\" => 3"
(eshell-wait-for-subprocess)
(eshell-match-result "OLLEH\n")))
+(ert-deftest eshell-test/pipe-subcommand ()
+ "Check that piping with an asynchronous subcommand works"
+ (skip-unless (and (executable-find "echo")
+ (executable-find "cat")))
+ (with-temp-eshell
+ (eshell-command-result-p "echo ${*echo hi} | *cat"
+ "hi")))
+
+(ert-deftest eshell-test/pipe-subcommand-with-pipe ()
+ "Check that piping with an asynchronous subcommand with its own pipe works"
+ (skip-unless (and (executable-find "echo")
+ (executable-find "cat")))
+ (with-temp-eshell
+ (eshell-command-result-p "echo ${*echo hi | *cat} | *cat"
+ "hi")))
+
(ert-deftest eshell-test/redirect-buffer ()
"Check that piping to a buffer works"
(with-temp-buffer