cmd/tests: Add basic mkdir tests.

This commit is contained in:
Frédéric Delanoy 2011-07-11 23:34:06 +02:00 committed by Alexandre Julliard
parent 63a6a80d40
commit 9114dc5c03
2 changed files with 57 additions and 0 deletions

View file

@ -149,6 +149,50 @@ if exist "file with spaces.dat" del "file with spaces.dat"
cd ..
rmdir "foo bar"
echo ----------- Testing mkdir -----------
call :setError 0
rem md and mkdir are synonymous
mkdir foobar
echo %ErrorLevel%
rmdir foobar
md foobar
echo %ErrorLevel%
rmdir foobar
rem Creating an already existing directory/file must fail
mkdir foobar
md foobar
echo %ErrorLevel%
rmdir foobar
echo > foobar
mkdir foobar
echo %ErrorLevel%
del foobar
rem Multi-level path creation
mkdir foo
echo %ErrorLevel%
mkdir foo\bar\baz
echo %ErrorLevel%
cd foo
echo %ErrorLevel%
cd bar
echo %ErrorLevel%
cd baz
echo %ErrorLevel%
echo > ..\..\bar2
mkdir ..\..\..\foo\bar2
echo %ErrorLevel%
del ..\..\bar2
mkdir ..\..\..\foo\bar2
echo %ErrorLevel%
rmdir ..\..\..\foo\bar2
cd ..
rmdir baz
cd ..
rmdir bar
cd ..
rmdir foo
echo %ErrorLevel%
echo -----------Testing Errorlevel-----------
rem nt 4.0 doesn't really support a way of setting errorlevel, so this is weak
rem See http://www.robvanderwoude.com/exit.php

View file

@ -102,6 +102,19 @@ r.test not found after delete, good
del /q * succeeded on file1
del /q * succeeded on file2.dat
------------ Testing del /s --------------
----------- Testing mkdir -----------
0
0
@todo_wine@1
@todo_wine@1
0
0
0
0
0
@todo_wine@1
0
0
-----------Testing Errorlevel-----------
1
errorlevel just right, good