cmd/tests: Add tests for stdout redirection and appending operators (resend)

Frédéric Delanoy frederic.delanoy at gmail.com
Tue Jul 26 14:32:07 CDT 2011


Rebased after yesterday's testbot update problems

---
 programs/cmd/tests/test_builtins.cmd     |   32 ++++++++++++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   21 +++++++++++++++++++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 2062a9d..572fb38 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -28,6 +28,38 @@ echo .word
 echo word at space@
 echo word at space@@space@
 
+echo ------------ Testing redirection operators --------------
+mkdir foobar & cd foobar
+echo ...stdout redirection
+echo foo>foo
+type foo
+echo foo 1> foo
+type foo
+echo foo1> foo
+type foo
+echo foo11> foo
+type foo
+echo foo12> foo
+type foo
+echo ...stdout appending
+echo foo>foo
+echo foo >>foo
+type foo
+del foo
+echo foob >> foo
+type foo
+echo fooc 1>>foo
+type foo
+echo food1>>foo
+type foo
+echo food2>>foo
+type foo
+del foo
+echo food21>>foo
+type foo
+cd ..
+rd /s/q foobar
+
 echo ------------ Testing ^^ escape character --------------
 rem Using something like "echo foo^" asks for an additional char after a "More?" prompt on the following line; it's not possible to currently test that non-interactively
 echo ^hell^o, world
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index d939ec5..d10aa4c 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -47,6 +47,27 @@ word
 .word
 word at space@
 word at space@@space@
+------------ Testing redirection operators --------------
+...stdout redirection
+foo
+foo at space@
+ at todo_wine@foo1
+ at todo_wine@foo11
+ at todo_wine@foo12
+...stdout appending
+foo
+foo at space@
+foob at space@
+foob at space@
+fooc at space@
+foob at space@
+fooc at space@
+ at todo_wine@food1
+ at todo_wine@foob at space@
+ at todo_wine@fooc at space@
+ at todo_wine@food1
+ at todo_wine@food2
+ at todo_wine@food21
 @todo_wine at ------------ Testing ^ escape character --------------
 @todo_wine at hello, world
 @todo_wine at hello, world
-- 
1.7.6




More information about the wine-patches mailing list