aboutsummaryrefslogtreecommitdiffstats
path: root/tests/exp-tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exp-tests')
-rw-r--r--tests/exp-tests20
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/exp-tests b/tests/exp-tests
index d45b702..45fe87c 100644
--- a/tests/exp-tests
+++ b/tests/exp-tests
@@ -163,14 +163,24 @@ expect '<^A^A^B>'
recho ''
# More tests of "$@"
-expect '< abc> <def> <ghi> <jkl >'
set abc def ghi jkl
+expect '< abc> <def> <ghi> <jkl >'
recho " $@ "
+expect '< abc> <def> <ghi> <jkl >'
+recho "${1+ $@ }"
-expect '<--abc> <def> <ghi> <jkl-->'
set abc def ghi jkl
+expect '<--abc> <def> <ghi> <jkl-->'
recho "--$@--"
+set "a b" cd ef gh
+expect '<a b> <cd> <ef> <gh>'
+recho ${1+"$@"}
+expect '<a b> <cd> <ef> <gh>'
+recho ${foo:-"$@"}
+expect '<a b> <cd> <ef> <gh>'
+recho "${@}"
+
expect '< >'
recho " "
expect '< - >'
@@ -324,3 +334,9 @@ recho '~'
expect nothing
recho $!
+
+# test word splitting of assignment statements not preceding a command
+a="a b c d e"
+declare b=$a
+expect '<a> <b> <c> <d> <e>'
+recho $b