cmd/tests: Add tests for & (un)conditional execution.

oldstable
Frédéric Delanoy 2011-07-23 15:34:20 +02:00 committed by Alexandre Julliard
parent d1e15baca7
commit 8b1d8e9e82
2 changed files with 22 additions and 3 deletions

View File

@ -94,6 +94,19 @@ echo P%ERRORLEVEL%
echo %ERRORLEVEL%S
echo P%ERRORLEVEL%S
echo ------------ Testing conditional execution --------------
echo ...unconditional ^&
call :setError 123 & echo foo1
echo bar2 & echo foo2
mkdir foobar & cd foobar
echo > foobazbar
cd .. & rd /s/q foobar
if exist foobazbar (
echo foobar not deleted!
cd ..
rd /s/q foobar
) else echo foobar deleted
echo ------------ Testing type ------------
echo bar> foobaz
@echo on
@ -105,7 +118,7 @@ echo ***
del foobaz
echo ------------ Testing NUL ------------
md foobar && cd foobar
md foobar & cd foobar
rem NUL file (non) creation + case insensitivity
rem Note: "if exist" does not work with NUL, so to check for file existence we use a kludgy workaround
echo > bar
@ -277,7 +290,7 @@ echo %ErrorLevel%
rem Trailing backslashes
mkdir foo\\\\
echo %ErrorLevel%
if exist foo (rmdir foo && echo dir created
if exist foo (rmdir foo & echo dir created
) else ( echo dir not created )
echo %ErrorLevel%
rem Invalid chars
@ -289,7 +302,7 @@ echo %ErrorLevel%
call :setError 0
mkdir foo\?
echo %ErrorLevel%
if exist foo (rmdir foo && echo ok, foo created
if exist foo (rmdir foo & echo ok, foo created
) else ( echo foo not created )
call :setError 0
mkdir foo\bar\?

View File

@ -90,6 +90,12 @@ ERRORLEVEL
P0
0S
P0S
------------ Testing conditional execution --------------
@todo_wine@...unconditional &
foo1
bar2@space@
foo2
@todo_wine@foobar deleted
------------ Testing type ------------
@pwd@>type foobaz@space@