From c96865f4458f357df41eeea73d456e15755b51f4 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 10 Apr 2009 00:20:58 +0000 Subject: hush: readability improvements. fix some more obscure bugs. a new redir4.tests is known to fail. --- shell/hush_test/hush-misc/redir1.right | 2 + shell/hush_test/hush-misc/redir1.tests | 6 +++ shell/hush_test/hush-misc/redir4.right | 25 +++++++++++ shell/hush_test/hush-misc/redir4.tests | 80 ++++++++++++++++++++++++++++++++++ 4 files changed, 113 insertions(+) create mode 100644 shell/hush_test/hush-misc/redir4.right create mode 100755 shell/hush_test/hush-misc/redir4.tests (limited to 'shell/hush_test/hush-misc') diff --git a/shell/hush_test/hush-misc/redir1.right b/shell/hush_test/hush-misc/redir1.right index ac90b4a0a..15515d1af 100644 --- a/shell/hush_test/hush-misc/redir1.right +++ b/shell/hush_test/hush-misc/redir1.right @@ -1,3 +1,5 @@ +Test 0: var:ok +File created:ok Test 1: var:ok File created:ok Test 2: var:ok diff --git a/shell/hush_test/hush-misc/redir1.tests b/shell/hush_test/hush-misc/redir1.tests index 7e204514c..70e9e17f0 100755 --- a/shell/hush_test/hush-misc/redir1.tests +++ b/shell/hush_test/hush-misc/redir1.tests @@ -1,3 +1,9 @@ +rm shell_test_$$ 2>/dev/null +var=bad +>shell_test_$$ var=ok +echo "Test 0: var:$var" +test -f shell_test_$$ && echo "File created:ok" + rm shell_test_$$ 2>/dev/null var=bad var=ok >shell_test_$$ diff --git a/shell/hush_test/hush-misc/redir4.right b/shell/hush_test/hush-misc/redir4.right new file mode 100644 index 000000000..ada6c2d85 --- /dev/null +++ b/shell/hush_test/hush-misc/redir4.right @@ -0,0 +1,25 @@ +shell_test +\shell_test +\shell_test +\shell_test +Here1 +Ok1 +Here2 +Ok2 +Here3 +Ok3 +Here4 +Ok4 +How with variable refs +shell_test_1 +\shell_test_1 +\shell_test_1 +\shell_test_1 +Here1 +Ok1 +Here2 +Ok2 +Here3 +Ok3 +Here4 +Ok4 diff --git a/shell/hush_test/hush-misc/redir4.tests b/shell/hush_test/hush-misc/redir4.tests new file mode 100755 index 000000000..ac2a44166 --- /dev/null +++ b/shell/hush_test/hush-misc/redir4.tests @@ -0,0 +1,80 @@ +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 How 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* + + +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 -- cgit v1.2.3