diff options
Diffstat (limited to 'test/lisp/eshell')
-rw-r--r-- | test/lisp/eshell/em-extpipe-tests.el | 2 | ||||
-rw-r--r-- | test/lisp/eshell/esh-var-tests.el | 19 |
2 files changed, 18 insertions, 3 deletions
diff --git a/test/lisp/eshell/em-extpipe-tests.el b/test/lisp/eshell/em-extpipe-tests.el index 91c2fba4791..3b84d763ac6 100644 --- a/test/lisp/eshell/em-extpipe-tests.el +++ b/test/lisp/eshell/em-extpipe-tests.el @@ -170,7 +170,7 @@ (em-extpipe-tests--deftest em-extpipe-test-13 "foo*|bar" (should-parse '(eshell-execute-pipeline - '((eshell-named-command (concat "foo" "*")) + '((eshell-named-command (eshell-concat nil "foo" "*")) (eshell-named-command "bar"))))) (em-extpipe-tests--deftest em-extpipe-test-14 "tac *<temp" diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 2ce6bb4f1ba..3f3b591c5ae 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el @@ -176,8 +176,17 @@ (should (equal (eshell-test-command-result "+ $(+ 1 2)$(+ 1 2) 3") 36))) (ert-deftest esh-var-test/interp-concat-cmd () - "Interpolate and concat command" - (should (equal (eshell-test-command-result "+ ${+ 1 2}3 3") 36))) + "Interpolate and concat command with literal" + (should (equal (eshell-test-command-result "+ ${+ 1 2}3 3") 36)) + (should (equal (eshell-test-command-result "echo ${*echo \"foo\nbar\"}-baz") + '("foo" "bar-baz"))) + ;; Concatenating to a number in a list should produce a number... + (should (equal (eshell-test-command-result "echo ${*echo \"1\n2\"}3") + '(1 23))) + ;; ... but concatenating to a string that looks like a number in a list + ;; should produce a string. + (should (equal (eshell-test-command-result "echo ${*echo \"hi\n2\"}3") + '("hi" "23")))) (ert-deftest esh-var-test/interp-concat-cmd2 () "Interpolate and concat two commands" @@ -326,6 +335,12 @@ inside double-quotes" "Interpolate command result redirected to temp file inside double-quotes" (should (equal (eshell-test-command-result "cat \"$<echo hi>\"") "hi"))) +(ert-deftest esh-var-test/quoted-interp-concat-cmd () + "Interpolate and concat command with literal" + (should (equal (eshell-test-command-result + "echo \"${echo \\\"foo\nbar\\\"} baz\"") + "foo\nbar baz"))) + ;; Interpolated variable conversion |