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

This commit is contained in:
Frédéric Delanoy 2011-08-27 02:11:32 +02:00 committed by Alexandre Julliard
parent 93a68fa659
commit a2eb505d2c
2 changed files with 46 additions and 0 deletions

View File

@ -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 --------------

View File

@ -144,6 +144,23 @@ food2
food21
@todo_wine@foo7@space@@space@@or_broken@not supported@space@
@todo_wine@foo@or_broken@not supported
...redirections within IF statements
@todo_wine@foo1
@todo_wine@foo2
@todo_wine@foo3
file does not exist, ok
foo4
baz5
baz6@space@
baz7
baz8
baz
foo@space@
baz
foo
A
B
C
@todo_wine@------------ Testing ^ escape character --------------
@todo_wine@hello, world
@todo_wine@hello, world