sh testsuite: sync ash-misc/source* and hush-misc/source*

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2016-10-02 18:23:14 +02:00
parent 0ba99705a1
commit c7a774dde4
10 changed files with 50 additions and 27 deletions

View File

@ -0,0 +1,4 @@
0:arg0 1:arg1 2:arg2
Ok1:0
0:arg0 1:q 2:w
Ok2:0

View File

@ -0,0 +1,8 @@
echo 'echo "0:$0 1:$1 2:$2"' >sourced1
set -- 1 2 3
"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
echo Ok1:$?
"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
echo Ok2:$?
rm sourced1

View File

@ -1,5 +1,2 @@
hush: syntax error: unterminated ${name}
line2
Ok1:0
hush: syntax error: unterminated '
Ok2:1
Sourced ok
Done

View File

@ -1,10 +1,5 @@
echo 'echo ${^}
echo line2' >sourced1
. ./sourced1
echo Ok1:$?
echo "echo '" >sourced1
. ./sourced1
echo Ok2:$?
rm sourced1
echo "echo Sourced ok" >../sourced.sh
PATH="..:$PATH"
. sourced.sh
rm ../sourced.sh
echo Done

View File

@ -1,4 +1 @@
0:arg0 1:arg1 2:arg2
Ok1:0
0:arg0 1:q 2:w
Ok2:0
Done: 0

View File

@ -1,8 +1,3 @@
echo 'echo "0:$0 1:$1 2:$2"' >sourced1
set -- 1 2 3
"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
echo Ok1:$?
"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
echo Ok2:$?
rm sourced1
false
. /dev/null
echo Done: $?

View File

@ -0,0 +1,5 @@
hush: syntax error: unterminated ${name}
line2
Ok1:0
hush: syntax error: unterminated '
Ok2:1

View File

@ -0,0 +1,10 @@
echo 'echo ${^}
echo line2' >sourced1
. ./sourced1
echo Ok1:$?
echo "echo '" >sourced1
. ./sourced1
echo Ok2:$?
rm sourced1

View File

@ -0,0 +1,4 @@
0:arg0 1:arg1 2:arg2
Ok1:0
0:arg0 1:q 2:w
Ok2:0

View File

@ -0,0 +1,8 @@
echo 'echo "0:$0 1:$1 2:$2"' >sourced1
set -- 1 2 3
"$THIS_SH" -c '. ./sourced1' arg0 arg1 arg2
echo Ok1:$?
"$THIS_SH" -c '. ./sourced1 q w e' arg0 arg1 arg2
echo Ok2:$?
rm sourced1