diff options
| author | Jim Porter | 2024-10-20 15:02:18 -0700 |
|---|---|---|
| committer | Jim Porter | 2024-10-20 18:03:45 -0700 |
| commit | 183c5efc0fe80074a40ebebb684d787baf578ffe (patch) | |
| tree | 1ab41f5a7a9d206dee0823ccd7341060186a3ef2 /test/lisp/eshell | |
| parent | 75fa0cc1ae2b53fe169fdcfef52bee6719eb38a7 (diff) | |
| download | emacs-183c5efc0fe80074a40ebebb684d787baf578ffe.tar.gz emacs-183c5efc0fe80074a40ebebb684d787baf578ffe.zip | |
Be more careful about applying spliced arguments
Previously, this could 'nonc' to a list that shouldn't be modified.
* lisp/eshell/esh-cmd.el (eshell-rewrite-named-command): Use 'append'
instead of 'nconc'.
* test/lisp/eshell/esh-var-tests.el (esh-var-test/interp-var-splice):
(esh-var-test/quoted-interp-var-splice): New tests.
Diffstat (limited to 'test/lisp/eshell')
| -rw-r--r-- | test/lisp/eshell/esh-var-tests.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/lisp/eshell/esh-var-tests.el b/test/lisp/eshell/esh-var-tests.el index 70f6e9c7777..38f90e615a8 100644 --- a/test/lisp/eshell/esh-var-tests.el +++ b/test/lisp/eshell/esh-var-tests.el | |||
| @@ -217,7 +217,8 @@ nil, use FUNCTION instead." | |||
| 217 | "Splice-interpolate list variable." | 217 | "Splice-interpolate list variable." |
| 218 | (let ((eshell-test-value '(1 2 3))) | 218 | (let ((eshell-test-value '(1 2 3))) |
| 219 | (eshell-command-result-equal "echo a $@eshell-test-value z" | 219 | (eshell-command-result-equal "echo a $@eshell-test-value z" |
| 220 | '("a" 1 2 3 "z")))) | 220 | '("a" 1 2 3 "z")) |
| 221 | (should (equal eshell-test-value '(1 2 3))))) | ||
| 221 | 222 | ||
| 222 | (ert-deftest esh-var-test/interp-var-splice-concat () | 223 | (ert-deftest esh-var-test/interp-var-splice-concat () |
| 223 | "Splice-interpolate and concat list variable." | 224 | "Splice-interpolate and concat list variable." |
| @@ -428,7 +429,8 @@ nil, use FUNCTION instead." | |||
| 428 | "Splice-interpolate list variable inside double-quotes." | 429 | "Splice-interpolate list variable inside double-quotes." |
| 429 | (let ((eshell-test-value '(1 2 3))) | 430 | (let ((eshell-test-value '(1 2 3))) |
| 430 | (eshell-command-result-equal "echo a \"$@eshell-test-value\" z" | 431 | (eshell-command-result-equal "echo a \"$@eshell-test-value\" z" |
| 431 | '("a" "1 2 3" "z")))) | 432 | '("a" "1 2 3" "z")) |
| 433 | (should (equal eshell-test-value '(1 2 3))))) | ||
| 432 | 434 | ||
| 433 | (ert-deftest esh-var-test/quoted-interp-var-splice-concat () | 435 | (ert-deftest esh-var-test/quoted-interp-var-splice-concat () |
| 434 | "Splice-interpolate and concat list variable inside double-quotes" | 436 | "Splice-interpolate and concat list variable inside double-quotes" |