Commit 8b1d8e9e authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

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

parent d1e15bac
...@@ -94,6 +94,19 @@ echo P%ERRORLEVEL% ...@@ -94,6 +94,19 @@ echo P%ERRORLEVEL%
echo %ERRORLEVEL%S echo %ERRORLEVEL%S
echo P%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 ------------ Testing type ------------
echo bar> foobaz echo bar> foobaz
@echo on @echo on
...@@ -105,7 +118,7 @@ echo *** ...@@ -105,7 +118,7 @@ echo ***
del foobaz del foobaz
echo ------------ Testing NUL ------------ echo ------------ Testing NUL ------------
md foobar && cd foobar md foobar & cd foobar
rem NUL file (non) creation + case insensitivity 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 rem Note: "if exist" does not work with NUL, so to check for file existence we use a kludgy workaround
echo > bar echo > bar
...@@ -277,7 +290,7 @@ echo %ErrorLevel% ...@@ -277,7 +290,7 @@ echo %ErrorLevel%
rem Trailing backslashes rem Trailing backslashes
mkdir foo\\\\ mkdir foo\\\\
echo %ErrorLevel% echo %ErrorLevel%
if exist foo (rmdir foo && echo dir created if exist foo (rmdir foo & echo dir created
) else ( echo dir not created ) ) else ( echo dir not created )
echo %ErrorLevel% echo %ErrorLevel%
rem Invalid chars rem Invalid chars
...@@ -289,7 +302,7 @@ echo %ErrorLevel% ...@@ -289,7 +302,7 @@ echo %ErrorLevel%
call :setError 0 call :setError 0
mkdir foo\? mkdir foo\?
echo %ErrorLevel% 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 ) ) else ( echo foo not created )
call :setError 0 call :setError 0
mkdir foo\bar\? mkdir foo\bar\?
......
...@@ -90,6 +90,12 @@ ERRORLEVEL ...@@ -90,6 +90,12 @@ ERRORLEVEL
P0 P0
0S 0S
P0S P0S
------------ Testing conditional execution --------------
@todo_wine@...unconditional &
foo1
bar2@space@
foo2
@todo_wine@foobar deleted
------------ Testing type ------------ ------------ Testing type ------------
@pwd@>type foobaz@space@ @pwd@>type foobaz@space@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment