Frédéric Delanoy : cmd/tests: Add tests for redirections within IF statements.

Alexandre Julliard julliard at winehq.org
Mon Aug 29 11:28:38 CDT 2011


Module: wine
Branch: master
Commit: a2eb505d2c4be6afe1301c364a5b6e9c8784ebc8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a2eb505d2c4be6afe1301c364a5b6e9c8784ebc8

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Sat Aug 27 02:11:32 2011 +0200

cmd/tests: Add tests for redirections within IF statements.

---

 programs/cmd/tests/test_builtins.cmd     |   29 +++++++++++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   17 +++++++++++++++++
 2 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 0f78376..bce966b 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -120,6 +120,35 @@ del foo
 echo foo> foo
 echo foo7 7>> foo || (echo not supported & del foo)
 if exist foo (type foo) else echo not supported
+echo ...redirections within IF statements
+if 1==1 echo foo1>bar
+type bar & del bar
+if 1==1 (echo foo2>bar) else echo baz2>bar
+type bar & del bar
+if 1==1 (echo foo3) else echo baz3>bar
+type bar || echo file does not exist, ok
+if 1==1 (echo foo4>bar) else echo baz4>bar
+type bar & del bar
+if 1==0 (echo foo5>bar) else echo baz5>bar
+type bar & del bar
+if 1==0 (echo foo6) else echo baz6 1>bar
+type bar & del bar
+if 1==0 (echo foo7 1>bar) else echo baz7>bar
+type bar & del bar
+if 1==0 (echo foo8 1>bar) else echo baz8>bak
+type bak
+if 1==1 (echo foo>bar & echo baz)
+type bar
+if 1==1 (
+   echo foo>bar
+   echo baz
+)
+type bar
+(if 1==1 (echo A) else echo B) > C
+type C
+(if 1==0 (echo A) else echo B) > C
+type C
+(if 1==0 (echo A > B) else echo C)
 cd .. & rd /s/q foobar
 
 echo ------------ Testing ^^ escape character --------------
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 1869117..eb7784f 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -144,6 +144,23 @@ food2
 food21
 @todo_wine at foo7@space@@space@@or_broken at not supported at space@
 @todo_wine at foo@or_broken at not supported
+...redirections within IF statements
+ at todo_wine@foo1
+ at todo_wine@foo2
+ at todo_wine@foo3
+file does not exist, ok
+foo4
+baz5
+baz6 at space@
+baz7
+baz8
+baz
+foo at space@
+baz
+foo
+A
+B
+C
 @todo_wine at ------------ Testing ^ escape character --------------
 @todo_wine at hello, world
 @todo_wine at hello, world




More information about the wine-cvs mailing list