summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenis Vlasenko2009-04-04 19:29:21 +0000
committerDenis Vlasenko2009-04-04 19:29:21 +0000
commit552433bc5af76c8e5b52278b3d609e9a18c19dc2 (patch)
treea12123629e6ce6779a9385ed17775ca8e9313808 /shell/hush_test
parenta24c8caeb29a11fafc748399ab6b30e6b8e638f0 (diff)
downloadbusybox-552433bc5af76c8e5b52278b3d609e9a18c19dc2.zip
busybox-552433bc5af76c8e5b52278b3d609e9a18c19dc2.tar.gz
hush: fix "var=val >file" not creating file
function old new delta static.null_ptr - 4 +4 run_list 2018 2020 +2 handle_dollar 667 626 -41 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 6/-41) Total: -35 bytes
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-misc/redir1.right10
-rwxr-xr-xshell/hush_test/hush-misc/redir1.tests32
2 files changed, 42 insertions, 0 deletions
diff --git a/shell/hush_test/hush-misc/redir1.right b/shell/hush_test/hush-misc/redir1.right
new file mode 100644
index 0000000..ac90b4a
--- /dev/null
+++ b/shell/hush_test/hush-misc/redir1.right
@@ -0,0 +1,10 @@
+Test 1: var:ok
+File created:ok
+Test 2: var:ok
+File created:ok
+Test 3: var:ok
+File created:ok
+Test 4: var:ok
+File created:ok
+Test 5: var:ok
+File created:ok
diff --git a/shell/hush_test/hush-misc/redir1.tests b/shell/hush_test/hush-misc/redir1.tests
new file mode 100755
index 0000000..5f6c206
--- /dev/null
+++ b/shell/hush_test/hush-misc/redir1.tests
@@ -0,0 +1,32 @@
+rm shell_test_$$ 2>/dev/null
+var=bad
+var=ok >shell_test_$$
+echo "Test 1: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+rm shell_test_$$ 2>/dev/null
+var=ok
+true | var=bad >shell_test_$$
+echo "Test 2: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+rm shell_test_$$ 2>/dev/null
+var=bad
+{ var=ok >shell_test_$$; }
+echo "Test 3: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+rm shell_test_$$ 2>/dev/null
+var=ok
+{ var=bad >shell_test_$$; } &
+usleep 100000
+echo "Test 4: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+rm shell_test_$$ 2>/dev/null
+var=ok
+( var=bad >shell_test_$$ )
+echo "Test 5: var:$var"
+test -f shell_test_$$ && echo "File created:ok"
+
+rm shell_test_$$ 2>/dev/null