cmd/tests: Add tests for NUL handling.

This commit is contained in:
Frédéric Delanoy 2011-07-19 09:49:24 +02:00 committed by Alexandre Julliard
parent 5ae558bac7
commit 5d22f3aa14
2 changed files with 37 additions and 0 deletions

View file

@ -104,6 +104,37 @@ type foobaz
echo ***
del foobaz
echo ------------ Testing NUL ------------
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
echo foo > NUL
dir /b /a-d
echo foo > nul
dir /b /a-d
echo foo > NuL
dir /b /a-d
del bar
rem NUL not special everywhere
call :setError 123
echo NUL> foo
if not exist foo (echo foo should have been created) else (
type foo
del foo
)
rem Empty file creation
copy nul foo > nul
if exist foo (
echo foo created
del foo
type foo
) else (
echo ***
)
cd ..
rd foobar
echo ------------ Testing if/else --------------
echo if/else should work with blocks
if 0 == 0 (

View file

@ -99,6 +99,12 @@ bar
***
bar
***
------------ Testing NUL ------------
bar
bar
bar
NUL
@todo_wine@foo created
------------ Testing if/else --------------
if/else should work with blocks
if seems to work