From 011d5c331c8d2ef161e2fda4ea8282466e33d347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delanoy?= Date: Tue, 26 Jul 2011 21:32:07 +0200 Subject: [PATCH] cmd/tests: Add tests for stdout redirection and appending operators. --- programs/cmd/tests/test_builtins.cmd | 32 ++++++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 21 ++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 2062a9d31d9..572fb386e26 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -28,6 +28,38 @@ echo .word echo word@space@ echo word@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 d939ec505ed..d10aa4ced07 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -47,6 +47,27 @@ word .word word@space@ word@space@@space@ +------------ Testing redirection operators -------------- +...stdout redirection +foo +foo@space@ +@todo_wine@foo1 +@todo_wine@foo11 +@todo_wine@foo12 +...stdout appending +foo +foo@space@ +foob@space@ +foob@space@ +fooc@space@ +foob@space@ +fooc@space@ +@todo_wine@food1 +@todo_wine@foob@space@ +@todo_wine@fooc@space@ +@todo_wine@food1 +@todo_wine@food2 +@todo_wine@food21 @todo_wine@------------ Testing ^ escape character -------------- @todo_wine@hello, world @todo_wine@hello, world