diff options
| author | Jim Porter | 2022-05-22 17:27:48 -0700 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-05-24 14:58:00 +0200 |
| commit | a49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d (patch) | |
| tree | d8ac3f279ad977d2ae21f42d27a389b6b53ecddd /test/lisp/eshell/eshell-tests.el | |
| parent | be17333acee2086d1c729197dfe64432f6ad6625 (diff) | |
| download | emacs-a49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d.tar.gz emacs-a49ecdd0ff2b2526fcc519bb23ce1f5113c8fb1d.zip | |
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.el | 16 |
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" | |||
| 114 | (eshell-wait-for-subprocess) | 114 | (eshell-wait-for-subprocess) |
| 115 | (eshell-match-result "OLLEH\n"))) | 115 | (eshell-match-result "OLLEH\n"))) |
| 116 | 116 | ||
| 117 | (ert-deftest eshell-test/pipe-subcommand () | ||
| 118 | "Check that piping with an asynchronous subcommand works" | ||
| 119 | (skip-unless (and (executable-find "echo") | ||
| 120 | (executable-find "cat"))) | ||
| 121 | (with-temp-eshell | ||
| 122 | (eshell-command-result-p "echo ${*echo hi} | *cat" | ||
| 123 | "hi"))) | ||
| 124 | |||
| 125 | (ert-deftest eshell-test/pipe-subcommand-with-pipe () | ||
| 126 | "Check that piping with an asynchronous subcommand with its own pipe works" | ||
| 127 | (skip-unless (and (executable-find "echo") | ||
| 128 | (executable-find "cat"))) | ||
| 129 | (with-temp-eshell | ||
| 130 | (eshell-command-result-p "echo ${*echo hi | *cat} | *cat" | ||
| 131 | "hi"))) | ||
| 132 | |||
| 117 | (ert-deftest eshell-test/redirect-buffer () | 133 | (ert-deftest eshell-test/redirect-buffer () |
| 118 | "Check that piping to a buffer works" | 134 | "Check that piping to a buffer works" |
| 119 | (with-temp-buffer | 135 | (with-temp-buffer |