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:
parent
621fc50e83
commit
4a1d8f6d6e
17
shell/ash_test/ash-psubst/emptytick.right
Normal file
17
shell/ash_test/ash-psubst/emptytick.right
Normal 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
|
16
shell/ash_test/ash-psubst/emptytick.tests
Executable file
16
shell/ash_test/ash-psubst/emptytick.tests
Executable 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
|
2
shell/ash_test/ash-psubst/tick.right
Normal file
2
shell/ash_test/ash-psubst/tick.right
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
1
|
4
shell/ash_test/ash-psubst/tick.tests
Executable file
4
shell/ash_test/ash-psubst/tick.tests
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
true
|
||||||
|
false; echo `echo $?`
|
||||||
|
true
|
||||||
|
{ false; echo `echo $?`; }
|
1
shell/ash_test/ash-psubst/tick2.right
Normal file
1
shell/ash_test/ash-psubst/tick2.right
Normal file
@ -0,0 +1 @@
|
|||||||
|
BAZ
|
5
shell/ash_test/ash-psubst/tick2.tests
Executable file
5
shell/ash_test/ash-psubst/tick2.tests
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
if false; then
|
||||||
|
echo "FOO"
|
||||||
|
tmp=`echo BAR >&2`
|
||||||
|
fi
|
||||||
|
echo BAZ
|
6
shell/ash_test/ash-psubst/tick3.right
Normal file
6
shell/ash_test/ash-psubst/tick3.right
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
\TESTZZBEST
|
||||||
|
$TEST
|
||||||
|
Q
|
||||||
|
a\bc
|
||||||
|
11-$a-\t-\-\"-`-\--\z-\*-\?-22 33-$a-\t-\-"-`-\--\z-\*-\?-44
|
||||||
|
done:0
|
14
shell/ash_test/ash-psubst/tick3.tests
Executable file
14
shell/ash_test/ash-psubst/tick3.tests
Executable 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:$?
|
7
shell/ash_test/ash-psubst/tick4.right
Normal file
7
shell/ash_test/ash-psubst/tick4.right
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
(TEST) BEST
|
||||||
|
TEST) BEST
|
||||||
|
((TEST) BEST
|
||||||
|
)
|
||||||
|
abc
|
||||||
|
a)c
|
||||||
|
OK: 0
|
7
shell/ash_test/ash-psubst/tick4.tests
Executable file
7
shell/ash_test/ash-psubst/tick4.tests
Executable 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: $?
|
3
shell/ash_test/ash-psubst/tick_huge.right
Normal file
3
shell/ash_test/ash-psubst/tick_huge.right
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
546ed3f5c81c780d3ab86ada14824237 -
|
||||||
|
546ed3f5c81c780d3ab86ada14824237 -
|
||||||
|
End
|
7
shell/ash_test/ash-psubst/tick_huge.tests
Executable file
7
shell/ash_test/ash-psubst/tick_huge.tests
Executable 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
|
Loading…
Reference in New Issue
Block a user