summaryrefslogtreecommitdiffstats
path: root/tests/dollar-at-star7.sub
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/dollar-at-star7.sub25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/dollar-at-star7.sub b/tests/dollar-at-star7.sub
new file mode 100644
index 0000000..47cb37f
--- /dev/null
+++ b/tests/dollar-at-star7.sub
@@ -0,0 +1,25 @@
+IFS='' # testing with only empty IFS
+
+set -- this is a test
+
+printf '|%s|\n' ${1+"$@"}
+echo
+printf '|%s|\n' "${1+$@}"
+echo
+printf '|%s|\n' "$@"
+echo
+
+printf '|%s|\n' ${1-"$@"}
+printf '|%s|\n' "${1-$@}"
+
+echo
+: ${foo:="$@"}
+printf '|%s|\n' "$foo"
+
+unset foo
+: "${foo:=$@}"
+printf '|%s|\n' "$foo"
+
+unset foo
+printf '|%s|\n' ${foo-"$@"}
+printf '|%s|\n' "${foo-$@}"