From 5e7b83c5661dc882c96cd3c616afc144ee22f13d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Wed, 26 Feb 2020 13:43:33 -0600 Subject: More sh tests. --- tests/sh.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/sh.test b/tests/sh.test index cf9d755d..6a121ce2 100755 --- a/tests/sh.test +++ b/tests/sh.test @@ -11,8 +11,10 @@ [ -z "$SH" ] && { [ -z "$TEST_HOST" ] && SH="sh" || export SH="bash" ; } # Test the sh -c stuff before changing EVAL -testing '$SH -c "" exit status 0' 'sh -c "" && echo $?' '0\n' '' '' -testing '$SH -c arg split' \ +testing '-c "" exit status 0' '$SH -c "" && echo $?' '0\n' '' '' +testing '-c args' "\$SH -c 'echo \$0,\$1,\$2,\$3' one two three four five" \ + "one,two,three,four\n" "" "" +testing '-c arg split' \ "$SH -c 'for i in a\"\$@\"b;do echo =\$i=;done;echo \$0' 123 456 789" \ "=a456=\n=789b=\n123\n" "" "" testing "exec3" '$C -c "{ exec readlink /proc/self/fd/0;} < /proc/self/exe"' \ @@ -56,6 +58,7 @@ testing "redir4" "touch /not/exist 2>out||grep -o /not/exist out" \ "/not/exist\n" "" "" testing "redir5" "ls out /not/exist &> out2 || wc -l < out2" "2\n" "" "" testing "redir6" "ls out /not/exist |& wc -l" "2\n" "" "" +testing "redir7" 'echo -n $(