msh: create testsuite (based on hush one)
hush: add TODO (doesn't know ":" command)
This commit is contained in:
1
shell/msh_test/msh-bugs/noeol3.right
Normal file
1
shell/msh_test/msh-bugs/noeol3.right
Normal file
@ -0,0 +1 @@
|
||||
hush: syntax error: unterminated "
|
2
shell/msh_test/msh-bugs/noeol3.tests
Executable file
2
shell/msh_test/msh-bugs/noeol3.tests
Executable file
@ -0,0 +1,2 @@
|
||||
# last line has no EOL!
|
||||
echo "unterminated
|
3
shell/msh_test/msh-bugs/process_subst.right
Normal file
3
shell/msh_test/msh-bugs/process_subst.right
Normal file
@ -0,0 +1,3 @@
|
||||
TESTzzBEST
|
||||
TEST$(echo zz)BEST
|
||||
TEST'BEST
|
3
shell/msh_test/msh-bugs/process_subst.tests
Executable file
3
shell/msh_test/msh-bugs/process_subst.tests
Executable file
@ -0,0 +1,3 @@
|
||||
echo "TEST`echo zz;echo;echo`BEST"
|
||||
echo "TEST`echo '$(echo zz)'`BEST"
|
||||
echo "TEST`echo "'"`BEST"
|
4
shell/msh_test/msh-bugs/read.right
Normal file
4
shell/msh_test/msh-bugs/read.right
Normal file
@ -0,0 +1,4 @@
|
||||
read
|
||||
cat
|
||||
echo "REPLY=$REPLY"
|
||||
REPLY=exec <read.tests
|
4
shell/msh_test/msh-bugs/read.tests
Executable file
4
shell/msh_test/msh-bugs/read.tests
Executable file
@ -0,0 +1,4 @@
|
||||
exec <read.tests
|
||||
read
|
||||
cat
|
||||
echo "REPLY=$REPLY"
|
6
shell/msh_test/msh-bugs/shift.right
Normal file
6
shell/msh_test/msh-bugs/shift.right
Normal file
@ -0,0 +1,6 @@
|
||||
./shift.tests abc d e
|
||||
./shift.tests d e 123
|
||||
./shift.tests d e 123
|
||||
./shift.tests
|
||||
./shift.tests
|
||||
./shift.tests
|
14
shell/msh_test/msh-bugs/shift.tests
Executable file
14
shell/msh_test/msh-bugs/shift.tests
Executable file
@ -0,0 +1,14 @@
|
||||
if test $# = 0; then
|
||||
exec "$THIS_SH" $0 abc "d e" 123
|
||||
fi
|
||||
echo $0 $1 $2
|
||||
shift
|
||||
echo $0 $1 $2
|
||||
shift 999
|
||||
echo $0 $1 $2
|
||||
shift 2
|
||||
echo $0 $1 $2
|
||||
shift 2
|
||||
echo $0 $1 $2
|
||||
shift
|
||||
echo $0 $1 $2
|
8
shell/msh_test/msh-bugs/starquoted.right
Normal file
8
shell/msh_test/msh-bugs/starquoted.right
Normal file
@ -0,0 +1,8 @@
|
||||
.1 abc d e f.
|
||||
.1.
|
||||
.abc.
|
||||
.d e f.
|
||||
.-1 abc d e f-.
|
||||
.-1.
|
||||
.abc.
|
||||
.d e f-.
|
8
shell/msh_test/msh-bugs/starquoted.tests
Executable file
8
shell/msh_test/msh-bugs/starquoted.tests
Executable file
@ -0,0 +1,8 @@
|
||||
if test $# = 0; then
|
||||
exec "$THIS_SH" "$0" 1 abc 'd e f'
|
||||
fi
|
||||
|
||||
for a in "$*"; do echo ".$a."; done
|
||||
for a in "$@"; do echo ".$a."; done
|
||||
for a in "-$*-"; do echo ".$a."; done
|
||||
for a in "-$@-"; do echo ".$a."; done
|
2
shell/msh_test/msh-bugs/syntax_err.right
Normal file
2
shell/msh_test/msh-bugs/syntax_err.right
Normal file
@ -0,0 +1,2 @@
|
||||
shown
|
||||
hush: syntax error: unterminated '
|
3
shell/msh_test/msh-bugs/syntax_err.tests
Executable file
3
shell/msh_test/msh-bugs/syntax_err.tests
Executable file
@ -0,0 +1,3 @@
|
||||
echo shown
|
||||
echo test `echo 'aa`
|
||||
echo not shown
|
5
shell/msh_test/msh-bugs/var_expand_in_assign.right
Normal file
5
shell/msh_test/msh-bugs/var_expand_in_assign.right
Normal file
@ -0,0 +1,5 @@
|
||||
. .
|
||||
.abc d e.
|
||||
.abc d e.
|
||||
.abc d e.
|
||||
.abc d e.
|
15
shell/msh_test/msh-bugs/var_expand_in_assign.tests
Executable file
15
shell/msh_test/msh-bugs/var_expand_in_assign.tests
Executable file
@ -0,0 +1,15 @@
|
||||
if test $# = 0; then
|
||||
exec "$THIS_SH" "$0" abc "d e"
|
||||
fi
|
||||
|
||||
space=' '
|
||||
echo .$space.
|
||||
|
||||
a=$*
|
||||
echo .$a.
|
||||
a=$@
|
||||
echo .$a.
|
||||
a="$*"
|
||||
echo .$a.
|
||||
a="$@"
|
||||
echo .$a.
|
3
shell/msh_test/msh-bugs/var_expand_in_redir.right
Normal file
3
shell/msh_test/msh-bugs/var_expand_in_redir.right
Normal file
@ -0,0 +1,3 @@
|
||||
TEST1
|
||||
TEST2
|
||||
TEST3
|
13
shell/msh_test/msh-bugs/var_expand_in_redir.tests
Executable file
13
shell/msh_test/msh-bugs/var_expand_in_redir.tests
Executable file
@ -0,0 +1,13 @@
|
||||
if test $# = 0; then
|
||||
exec "$THIS_SH" "$0" abc "d e"
|
||||
fi
|
||||
|
||||
echo TEST1 >"$1.out"
|
||||
echo TEST2 >"$2.out"
|
||||
# bash says: "$@.out": ambiguous redirect
|
||||
# ash handles it as if it is '$*' - we do the same
|
||||
echo TEST3 >"$@.out"
|
||||
|
||||
cat abc.out "d e.out" "abc d e.out"
|
||||
|
||||
rm abc.out "d e.out" "abc d e.out"
|
Reference in New Issue
Block a user