summaryrefslogtreecommitdiff
path: root/test/lisp/eshell/eshell-tests.el
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-01-21 10:32:00 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2022-01-21 10:32:00 +0100
commit587edc46dfc0aa035c49a5c97ff36472e2c4dbfd (patch)
tree6fbaf9ec3124706ea25aab0421bbe1c3393cfaa1 /test/lisp/eshell/eshell-tests.el
parenta6ad584ac27dcc6bbe2476face53a3165f99366d (diff)
downloademacs-587edc46dfc0aa035c49a5c97ff36472e2c4dbfd.tar.gz
Further improve determination of when commands can be invoked directly
This covers the case when a subcommand is to be invoked in more places than before, for example when a subcommand is concatenated in an argument. * lisp/eshell/esh-cmd.el (eshell--find-subcommands): New fuction. (eshell--invoke-command-directly): Use 'eshell-find-subcommands'. * test/lisp/eshell/eshell-tests.el (eshell-test/interp-cmd-external-concat): New test (bug#30725).
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 c4cb9bf4850..1a7ab0ab06f 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -167,6 +167,13 @@ e.g. \"{(+ 1 2)} 3\" => 3"
(eshell-command-result-p "echo ${*echo hi}"
"hi\n")))
+(ert-deftest eshell-test/interp-cmd-external-concat ()
+ "Interpolate command result from external command with concatenation"
+ (skip-unless (executable-find "echo"))
+ (with-temp-eshell
+ (eshell-command-result-p "echo ${echo hi}-${*echo there}"
+ "hi-there\n")))
+
(ert-deftest eshell-test/window-height ()
"$LINES should equal (window-height)"
(should (eshell-test-command-result "= $LINES (window-height)")))