mirror of
https://github.com/sheumann/hush.git
synced 2024-11-15 12:08:09 +00:00
sh testsuite: sync ash-redir/ and hush-redir/
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
c7a774dde4
commit
df303ae117
1
shell/ash_test/ash-redir/redir_escapednum.right
Normal file
1
shell/ash_test/ash-redir/redir_escapednum.right
Normal file
@ -0,0 +1 @@
|
||||
Ok
|
2
shell/ash_test/ash-redir/redir_escapednum.tests
Executable file
2
shell/ash_test/ash-redir/redir_escapednum.tests
Executable file
@ -0,0 +1,2 @@
|
||||
echo NOT SHOWN \2>/dev/null
|
||||
echo Ok
|
18
shell/ash_test/ash-redir/redir_expand.right
Normal file
18
shell/ash_test/ash-redir/redir_expand.right
Normal file
@ -0,0 +1,18 @@
|
||||
shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
Here1
|
||||
Ok1
|
||||
Here2
|
||||
Ok2
|
||||
Here3
|
||||
Ok3
|
||||
Here4
|
||||
Ok4
|
||||
Now with variable refs
|
||||
shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
Done
|
85
shell/ash_test/ash-redir/redir_expand.tests
Executable file
85
shell/ash_test/ash-redir/redir_expand.tests
Executable file
@ -0,0 +1,85 @@
|
||||
rm *shell_test* 2>/dev/null
|
||||
|
||||
>\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
|
||||
cat <<\shell_test
|
||||
Here1
|
||||
shell_test
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test
|
||||
Here2
|
||||
\shell_test
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test"
|
||||
Here3
|
||||
\shell_test
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test"
|
||||
Here4
|
||||
\shell_test
|
||||
echo Ok4
|
||||
|
||||
|
||||
echo Now with variable refs
|
||||
i=1
|
||||
|
||||
|
||||
>\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
echo Done;exit
|
||||
# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
|
||||
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
|
||||
# does not mandate this behavior.
|
||||
# This is not likely to be used much in real-world.
|
||||
|
||||
cat <<\shell_test_$i
|
||||
Here1
|
||||
shell_test_$i
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test_$i
|
||||
Here2
|
||||
\shell_test_$i
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test_$i"
|
||||
Here3
|
||||
\shell_test_$i
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test_$i"
|
||||
Here4
|
||||
\shell_test_$i
|
||||
echo Ok4
|
4
shell/ash_test/ash-redir/redir_multi.right
Normal file
4
shell/ash_test/ash-redir/redir_multi.right
Normal file
@ -0,0 +1,4 @@
|
||||
Testing multiple redirections to same fd
|
||||
Hello
|
||||
Done1
|
||||
Done2
|
5
shell/ash_test/ash-redir/redir_multi.tests
Executable file
5
shell/ash_test/ash-redir/redir_multi.tests
Executable file
@ -0,0 +1,5 @@
|
||||
echo "Testing multiple redirections to same fd"
|
||||
# bug was making us lose fd #1 after this:
|
||||
echo Hello >/dev/null 1>&2
|
||||
echo Done1
|
||||
echo Done2 >&2
|
@ -1 +1 @@
|
||||
Ok
|
||||
OK
|
||||
|
@ -1,2 +1,5 @@
|
||||
echo NOT SHOWN \2>/dev/null
|
||||
echo Ok
|
||||
# ash once couldn't redirect above fd#9
|
||||
exec 1>/dev/null
|
||||
(echo LOST1 >&22) 22>&1
|
||||
(echo LOST2 >&22) 22>&1
|
||||
(echo OK >&22) 22>&2
|
||||
|
@ -1,18 +1 @@
|
||||
shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
Here1
|
||||
Ok1
|
||||
Here2
|
||||
Ok2
|
||||
Here3
|
||||
Ok3
|
||||
Here4
|
||||
Ok4
|
||||
Now with variable refs
|
||||
shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
Done
|
||||
OK
|
||||
|
@ -1,85 +1,72 @@
|
||||
rm *shell_test* 2>/dev/null
|
||||
|
||||
>\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
|
||||
cat <<\shell_test
|
||||
Here1
|
||||
shell_test
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test
|
||||
Here2
|
||||
\shell_test
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test"
|
||||
Here3
|
||||
\shell_test
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test"
|
||||
Here4
|
||||
\shell_test
|
||||
echo Ok4
|
||||
|
||||
|
||||
echo Now with variable refs
|
||||
i=1
|
||||
|
||||
|
||||
>\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
echo Done;exit
|
||||
# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
|
||||
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
|
||||
# does not mandate this behavior.
|
||||
# This is not likely to be used much in real-world.
|
||||
|
||||
cat <<\shell_test_$i
|
||||
Here1
|
||||
shell_test_$i
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test_$i
|
||||
Here2
|
||||
\shell_test_$i
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test_$i"
|
||||
Here3
|
||||
\shell_test_$i
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test_$i"
|
||||
Here4
|
||||
\shell_test_$i
|
||||
echo Ok4
|
||||
# ash uses fd 10 (usually) for reading the script
|
||||
exec 13>&-
|
||||
exec 12>&-
|
||||
exec 11>&-
|
||||
exec 10>&-
|
||||
# some amount of input is prefetched.
|
||||
# make sure final echo is far enough to not be prefetched.
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
###############################################################
|
||||
echo "OK"
|
||||
|
@ -1,4 +1,2 @@
|
||||
Testing multiple redirections to same fd
|
||||
Hello
|
||||
Done1
|
||||
Done2
|
||||
OK
|
||||
|
@ -1,5 +1,3 @@
|
||||
echo "Testing multiple redirections to same fd"
|
||||
# bug was making us lose fd #1 after this:
|
||||
echo Hello >/dev/null 1>&2
|
||||
echo Done1
|
||||
echo Done2 >&2
|
||||
# we had a bug where this would hang
|
||||
(head -n 1 <redir6.right)
|
||||
echo OK
|
||||
|
1
shell/hush_test/hush-redir/redir_escapednum.right
Normal file
1
shell/hush_test/hush-redir/redir_escapednum.right
Normal file
@ -0,0 +1 @@
|
||||
Ok
|
2
shell/hush_test/hush-redir/redir_escapednum.tests
Executable file
2
shell/hush_test/hush-redir/redir_escapednum.tests
Executable file
@ -0,0 +1,2 @@
|
||||
echo NOT SHOWN \2>/dev/null
|
||||
echo Ok
|
18
shell/hush_test/hush-redir/redir_expand.right
Normal file
18
shell/hush_test/hush-redir/redir_expand.right
Normal file
@ -0,0 +1,18 @@
|
||||
shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
\shell_test
|
||||
Here1
|
||||
Ok1
|
||||
Here2
|
||||
Ok2
|
||||
Here3
|
||||
Ok3
|
||||
Here4
|
||||
Ok4
|
||||
Now with variable refs
|
||||
shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
\shell_test_1
|
||||
Done
|
85
shell/hush_test/hush-redir/redir_expand.tests
Executable file
85
shell/hush_test/hush-redir/redir_expand.tests
Executable file
@ -0,0 +1,85 @@
|
||||
rm *shell_test* 2>/dev/null
|
||||
|
||||
>\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
|
||||
cat <<\shell_test
|
||||
Here1
|
||||
shell_test
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test
|
||||
Here2
|
||||
\shell_test
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test"
|
||||
Here3
|
||||
\shell_test
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test"
|
||||
Here4
|
||||
\shell_test
|
||||
echo Ok4
|
||||
|
||||
|
||||
echo Now with variable refs
|
||||
i=1
|
||||
|
||||
|
||||
>\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>\\shell_test_$i
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
>"\\shell_test_$i"
|
||||
echo *shell_test*
|
||||
rm *shell_test*
|
||||
|
||||
echo Done;exit
|
||||
# UNFIXED BUG. bash apparently will expand $i even in terminating delimiter.
|
||||
# http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
|
||||
# does not mandate this behavior.
|
||||
# This is not likely to be used much in real-world.
|
||||
|
||||
cat <<\shell_test_$i
|
||||
Here1
|
||||
shell_test_$i
|
||||
echo Ok1
|
||||
|
||||
cat <<\\shell_test_$i
|
||||
Here2
|
||||
\shell_test_$i
|
||||
echo Ok2
|
||||
|
||||
cat <<"\shell_test_$i"
|
||||
Here3
|
||||
\shell_test_$i
|
||||
echo Ok3
|
||||
|
||||
cat <<"\\shell_test_$i"
|
||||
Here4
|
||||
\shell_test_$i
|
||||
echo Ok4
|
4
shell/hush_test/hush-redir/redir_multi.right
Normal file
4
shell/hush_test/hush-redir/redir_multi.right
Normal file
@ -0,0 +1,4 @@
|
||||
Testing multiple redirections to same fd
|
||||
Hello
|
||||
Done1
|
||||
Done2
|
5
shell/hush_test/hush-redir/redir_multi.tests
Executable file
5
shell/hush_test/hush-redir/redir_multi.tests
Executable file
@ -0,0 +1,5 @@
|
||||
echo "Testing multiple redirections to same fd"
|
||||
# bug was making us lose fd #1 after this:
|
||||
echo Hello >/dev/null 1>&2
|
||||
echo Done1
|
||||
echo Done2 >&2
|
Loading…
Reference in New Issue
Block a user