diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-02 19:57:53 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-02 19:57:53 +0000 |
commit | a43dba76ea394d789de67c6322b51e1d65bdba3b (patch) | |
tree | c99cde48cb834d4310ec06b3d377783029103ae1 /shell/msh_test/msh-bugs | |
parent | 444639cc2134d483bf0845416e9b6ce8935af795 (diff) | |
download | busybox-a43dba76ea394d789de67c6322b51e1d65bdba3b.tar.gz |
msh: create testsuite (based on hush one)
hush: add TODO (doesn't know ":" command)
Diffstat (limited to 'shell/msh_test/msh-bugs')
-rw-r--r-- | shell/msh_test/msh-bugs/noeol3.right | 1 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/noeol3.tests | 2 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/process_subst.right | 3 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/process_subst.tests | 3 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/read.right | 4 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/read.tests | 4 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/shift.right | 6 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/shift.tests | 14 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/starquoted.right | 8 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/starquoted.tests | 8 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/syntax_err.right | 2 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/syntax_err.tests | 3 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/var_expand_in_assign.right | 5 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/var_expand_in_assign.tests | 15 | ||||
-rw-r--r-- | shell/msh_test/msh-bugs/var_expand_in_redir.right | 3 | ||||
-rwxr-xr-x | shell/msh_test/msh-bugs/var_expand_in_redir.tests | 13 |
16 files changed, 94 insertions, 0 deletions
diff --git a/shell/msh_test/msh-bugs/noeol3.right b/shell/msh_test/msh-bugs/noeol3.right new file mode 100644 index 000000000..56f8515b7 --- /dev/null +++ b/shell/msh_test/msh-bugs/noeol3.right @@ -0,0 +1 @@ +hush: syntax error: unterminated " diff --git a/shell/msh_test/msh-bugs/noeol3.tests b/shell/msh_test/msh-bugs/noeol3.tests new file mode 100755 index 000000000..ec958ed7a --- /dev/null +++ b/shell/msh_test/msh-bugs/noeol3.tests @@ -0,0 +1,2 @@ +# last line has no EOL! +echo "unterminated
\ No newline at end of file diff --git a/shell/msh_test/msh-bugs/process_subst.right b/shell/msh_test/msh-bugs/process_subst.right new file mode 100644 index 000000000..397bc8067 --- /dev/null +++ b/shell/msh_test/msh-bugs/process_subst.right @@ -0,0 +1,3 @@ +TESTzzBEST +TEST$(echo zz)BEST +TEST'BEST diff --git a/shell/msh_test/msh-bugs/process_subst.tests b/shell/msh_test/msh-bugs/process_subst.tests new file mode 100755 index 000000000..21996bc0e --- /dev/null +++ b/shell/msh_test/msh-bugs/process_subst.tests @@ -0,0 +1,3 @@ +echo "TEST`echo zz;echo;echo`BEST" +echo "TEST`echo '$(echo zz)'`BEST" +echo "TEST`echo "'"`BEST" diff --git a/shell/msh_test/msh-bugs/read.right b/shell/msh_test/msh-bugs/read.right new file mode 100644 index 000000000..0e50e2a23 --- /dev/null +++ b/shell/msh_test/msh-bugs/read.right @@ -0,0 +1,4 @@ +read +cat +echo "REPLY=$REPLY" +REPLY=exec <read.tests diff --git a/shell/msh_test/msh-bugs/read.tests b/shell/msh_test/msh-bugs/read.tests new file mode 100755 index 000000000..ff1acbde1 --- /dev/null +++ b/shell/msh_test/msh-bugs/read.tests @@ -0,0 +1,4 @@ +exec <read.tests +read +cat +echo "REPLY=$REPLY" diff --git a/shell/msh_test/msh-bugs/shift.right b/shell/msh_test/msh-bugs/shift.right new file mode 100644 index 000000000..d281e358c --- /dev/null +++ b/shell/msh_test/msh-bugs/shift.right @@ -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 diff --git a/shell/msh_test/msh-bugs/shift.tests b/shell/msh_test/msh-bugs/shift.tests new file mode 100755 index 000000000..53ef249f2 --- /dev/null +++ b/shell/msh_test/msh-bugs/shift.tests @@ -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 diff --git a/shell/msh_test/msh-bugs/starquoted.right b/shell/msh_test/msh-bugs/starquoted.right new file mode 100644 index 000000000..b56323fe1 --- /dev/null +++ b/shell/msh_test/msh-bugs/starquoted.right @@ -0,0 +1,8 @@ +.1 abc d e f. +.1. +.abc. +.d e f. +.-1 abc d e f-. +.-1. +.abc. +.d e f-. diff --git a/shell/msh_test/msh-bugs/starquoted.tests b/shell/msh_test/msh-bugs/starquoted.tests new file mode 100755 index 000000000..2fe49b1cd --- /dev/null +++ b/shell/msh_test/msh-bugs/starquoted.tests @@ -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 diff --git a/shell/msh_test/msh-bugs/syntax_err.right b/shell/msh_test/msh-bugs/syntax_err.right new file mode 100644 index 000000000..08a270c31 --- /dev/null +++ b/shell/msh_test/msh-bugs/syntax_err.right @@ -0,0 +1,2 @@ +shown +hush: syntax error: unterminated ' diff --git a/shell/msh_test/msh-bugs/syntax_err.tests b/shell/msh_test/msh-bugs/syntax_err.tests new file mode 100755 index 000000000..d10ed42e9 --- /dev/null +++ b/shell/msh_test/msh-bugs/syntax_err.tests @@ -0,0 +1,3 @@ +echo shown +echo test `echo 'aa` +echo not shown diff --git a/shell/msh_test/msh-bugs/var_expand_in_assign.right b/shell/msh_test/msh-bugs/var_expand_in_assign.right new file mode 100644 index 000000000..352210d7e --- /dev/null +++ b/shell/msh_test/msh-bugs/var_expand_in_assign.right @@ -0,0 +1,5 @@ +. . +.abc d e. +.abc d e. +.abc d e. +.abc d e. diff --git a/shell/msh_test/msh-bugs/var_expand_in_assign.tests b/shell/msh_test/msh-bugs/var_expand_in_assign.tests new file mode 100755 index 000000000..18cdc74c0 --- /dev/null +++ b/shell/msh_test/msh-bugs/var_expand_in_assign.tests @@ -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. diff --git a/shell/msh_test/msh-bugs/var_expand_in_redir.right b/shell/msh_test/msh-bugs/var_expand_in_redir.right new file mode 100644 index 000000000..423299c97 --- /dev/null +++ b/shell/msh_test/msh-bugs/var_expand_in_redir.right @@ -0,0 +1,3 @@ +TEST1 +TEST2 +TEST3 diff --git a/shell/msh_test/msh-bugs/var_expand_in_redir.tests b/shell/msh_test/msh-bugs/var_expand_in_redir.tests new file mode 100755 index 000000000..bda6bdd7f --- /dev/null +++ b/shell/msh_test/msh-bugs/var_expand_in_redir.tests @@ -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" |