aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-05-26 05:23:58 -0500
committerRob Landley <rob@landley.net>2020-05-26 05:23:58 -0500
commit6b6436c848035abfff92a86b00305847bc6c0b9d (patch)
tree2f41aad9c2410858e30fac21a9b10b03257573ce /tests
parentbc6ce6628c2517aa419b5551b8d378da794b84f2 (diff)
downloadtoybox-6b6436c848035abfff92a86b00305847bc6c0b9d.tar.gz
Fix syntax checking for "if true; then echo hello | fi", fix some tests,
slightly more elaborate debug output.
Diffstat (limited to 'tests')
-rw-r--r--tests/sh.test4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/sh.test b/tests/sh.test
index 7bab1a60..6e3944fb 100644
--- a/tests/sh.test
+++ b/tests/sh.test
@@ -41,7 +41,9 @@ testing "exec3" '$C -c "{ exec readlink /proc/self/fd/0;} < /proc/self/exe"' \
"$(readlink -f $C)\n" "" ""
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" "" ""
-testing '(subshell)' '$C -c "(echo hello)"' 'hello\n' '' ''
+testing '(subshell)' '$SH -c "(echo hello)"' 'hello\n' '' ''
+testing 'syntax' '$SH -c "if true; then echo hello | fi" 2>/dev/null || echo x'\
+ 'x\n' '' ''
# The bash man page is lying when it says $_ starts with an absolute path.
ln -s $(which $SH) bash