cmd/tests: Segment mkdir tests for an easier read.

This commit is contained in:
Frédéric Delanoy 2011-09-12 20:28:03 +02:00 committed by Alexandre Julliard
parent c03f813c87
commit 8fff969ce6
2 changed files with 12 additions and 6 deletions

View File

@ -881,14 +881,14 @@ rmdir "foo bar"
echo ----------- Testing mkdir ----------- echo ----------- Testing mkdir -----------
call :setError 0 call :setError 0
rem md and mkdir are synonymous echo ... md and mkdir are synonymous ...
mkdir foobar mkdir foobar
echo %ErrorLevel% echo %ErrorLevel%
rmdir foobar rmdir foobar
md foobar md foobar
echo %ErrorLevel% echo %ErrorLevel%
rmdir foobar rmdir foobar
rem Creating an already existing directory/file must fail echo ... creating an already existing directory/file must fail ...
mkdir foobar mkdir foobar
md foobar md foobar
echo %ErrorLevel% echo %ErrorLevel%
@ -897,7 +897,7 @@ echo > foobar
mkdir foobar mkdir foobar
echo %ErrorLevel% echo %ErrorLevel%
del foobar del foobar
rem Multi-level path creation echo ... multilevel path creation ...
mkdir foo mkdir foo
echo %ErrorLevel% echo %ErrorLevel%
mkdir foo\bar\baz mkdir foo\bar\baz
@ -922,13 +922,13 @@ rmdir bar
cd .. cd ..
rmdir foo rmdir foo
echo %ErrorLevel% echo %ErrorLevel%
rem Trailing backslashes echo ... 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 echo ... invalid chars ...
mkdir ? mkdir ?
echo mkdir ? gives errorlevel %ErrorLevel% echo mkdir ? gives errorlevel %ErrorLevel%
call :setError 0 call :setError 0
@ -954,7 +954,7 @@ if not exist foo (
cd .. cd ..
rmdir foo rmdir foo
) )
rem multiples directories at once echo ... multiple directories at once ...
mkdir foobaz & cd foobaz mkdir foobaz & cd foobaz
mkdir foo bar\baz foobar mkdir foo bar\baz foobar
if exist foo (echo foo created) else echo foo not created! if exist foo (echo foo created) else echo foo not created!

View File

@ -595,10 +595,13 @@ del /q * succeeded on file1
del /q * succeeded on file2.dat del /q * succeeded on file2.dat
------------ Testing del /s -------------- ------------ Testing del /s --------------
----------- Testing mkdir ----------- ----------- Testing mkdir -----------
... md and mkdir are synonymous ...
0 0
0 0
... creating an already existing directory/file must fail ...
1 1
1 1
... multilevel path creation ...
0 0
0 0
0 0
@ -607,15 +610,18 @@ del /q * succeeded on file2.dat
1 1
0 0
0 0
... trailing backslashes ...
0 0
dir created dir created
0 0
... invalid chars ...
mkdir ? gives errorlevel 1 mkdir ? gives errorlevel 1
mkdir ?\foo gives errorlevel 1 mkdir ?\foo gives errorlevel 1
mkdir foo\? gives errorlevel 1 mkdir foo\? gives errorlevel 1
ok, foo created ok, foo created
mkdir foo\bar\? gives errorlevel 1 mkdir foo\bar\? gives errorlevel 1
ok, foo\bar created ok, foo\bar created
... multiple directories at once ...
foo created foo created
bar created bar created
foobar created foobar created