From 6b6436c848035abfff92a86b00305847bc6c0b9d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 26 May 2020 05:23:58 -0500 Subject: Fix syntax checking for "if true; then echo hello | fi", fix some tests, slightly more elaborate debug output. --- tests/sh.test | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests') 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 -- cgit v1.2.3