aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-05-03 23:15:35 -0500
committerRob Landley <rob@landley.net>2020-05-03 23:15:35 -0500
commite9396994d328606ff436b87bea3a0321bba98809 (patch)
tree497cc2fbda98a124d9dc9dd836d80d5b92028702 /tests
parentb0ed57b1aad9d2a0cfb64999cc1e0bc15471a48c (diff)
downloadtoybox-e9396994d328606ff436b87bea3a0321bba98809.tar.gz
Next round of shell work.
Diffstat (limited to 'tests')
-rw-r--r--tests/sh.test7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/sh.test b/tests/sh.test
index 28b453f0..0759398d 100644
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -42,7 +42,10 @@ testing "exec3" '$C -c "{ exec readlink /proc/self/fd/0;} < /proc/self/exe"' \
testing 'arg shift' "$SH -c '"'for i in "" 2 1 1 1; do echo $? $1; shift $i; done'"' one two three four five" \
"0 two\n0 three\n0 five\n0\n1\n" "" ""
-
+# The bash man page is lying when it says $_ starts with an absolute path.
+ln -s $(which $SH) bash
+testing 'non-absolute $_' "./bash -c 'echo \$_'" './bash\n' '' ''
+rm bash
testing 'exec exitval' "$SH -c 'exec echo hello' && echo \$?" "hello\n0\n" "" ""
testing 'simple script' '$SH input' 'input\n' 'echo $0' ''
@@ -61,7 +64,7 @@ testing 'IFS $*' "$SH -c 'IFS=xy; echo \"\$*\"' one two tyree" "twoxtyree\n" \
"" ""
testing 'default exports' \
- "env -i \"$(which $SH)\" --noprofile -norc -c env | sort" \
+ "env -i \"$(which $SH)\" --noprofile --norc -c env | sort" \
"PWD=$(pwd)\nSHLVL=1\n_=$(which env)\n" "" ""
# Change EVAL to call sh -c for us, using "bash" explicitly for the host.