ash: add most of hush process subst tests

ash passes these.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-07-24 12:49:49 +02:00
parent 621fc50e83
commit 4a1d8f6d6e
12 changed files with 89 additions and 0 deletions

View File

@ -0,0 +1,17 @@
0
0
./emptytick.tests: line 3: : Permission denied
127
./emptytick.tests: line 4: : Permission denied
127
0
0
0
0
./emptytick.tests: line 10: : Permission denied
127
./emptytick.tests: line 11: : Permission denied
127
0
0
./emptytick.tests: exec: line 15: : Permission denied

View File

@ -0,0 +1,16 @@
true; ``; echo $?
false; ``; echo $?
true; `""`; echo $?
false; `""`; echo $?
true; ` `; echo $?
false; ` `; echo $?
true; $(); echo $?
false; $(); echo $?
true; $(""); echo $?
false; $(""); echo $?
true; $( ); echo $?
false; $( ); echo $?
exec ''; echo $?
echo Not reached

View File

@ -0,0 +1,2 @@
1
1

View File

@ -0,0 +1,4 @@
true
false; echo `echo $?`
true
{ false; echo `echo $?`; }

View File

@ -0,0 +1 @@
BAZ

View File

@ -0,0 +1,5 @@
if false; then
echo "FOO"
tmp=`echo BAR >&2`
fi
echo BAZ

View File

@ -0,0 +1,6 @@
\TESTZZBEST
$TEST
Q
a\bc
11-$a-\t-\-\"-`-\--\z-\*-\?-22 33-$a-\t-\-"-`-\--\z-\*-\?-44
done:0

View File

@ -0,0 +1,14 @@
test "$CONFIG_FEATURE_FANCY_ECHO" = "y" || exit 77
TEST=Q
# \` is special
echo `echo '\'TEST\`echo ZZ\`BEST`
# \$ and \\ are special
echo `echo \\$TEST`
echo `echo \$TEST`
echo a`echo \\\\b`c
# \" is not special if in unquoted `cmd` (passed verbatim WITH \),
# but is special in quoted one
echo `echo 11'-$a-\t-\\-\"-\`-\--\z-\*-\?-'22` "`echo 33'-$a-\t-\\-\"-\`-\--\z-\*-\?-'44`"
echo done:$?

View File

@ -0,0 +1,7 @@
(TEST) BEST
TEST) BEST
((TEST) BEST
)
abc
a)c
OK: 0

View File

@ -0,0 +1,7 @@
echo $(echo '(TEST)' BEST)
echo $(echo 'TEST)' BEST)
echo $(echo \(\(TEST\) BEST)
echo $(echo \))
echo $(echo a"`echo "b"`"c )
echo $(echo a"`echo ")"`"c )
echo OK: $?

View File

@ -0,0 +1,3 @@
546ed3f5c81c780d3ab86ada14824237 -
546ed3f5c81c780d3ab86ada14824237 -
End

View File

@ -0,0 +1,7 @@
# This creates 120k file
yes "123456789 123456789 123456789 123456789" | head -3000 >>"$0.tmp"
echo "`cat $0.tmp`" | md5sum
rm "$0.tmp"
yes "123456789 123456789 123456789 123456789" | head -3000 | md5sum
echo End