[1/2] cmd/tests: Add tests for recursive rmdir (try 2)

Frédéric Delanoy frederic.delanoy at gmail.com
Tue Jul 19 02:49:25 CDT 2011


---
 programs/cmd/tests/test_builtins.cmd     |   21 +++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |    2 ++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index 982fd23..a0b243e 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -308,6 +308,27 @@ echo %ErrorLevel%
 if exist foo echo non-empty dir not removed
 rmdir foo\bar
 rmdir foo
+rem Recursive rmdir
+mkdir foo\bar\baz
+rmdir /s /Q foo
+if not exist foo (
+    echo recursive rmdir succeeded
+) else (
+    rd foo\bar\baz
+    rd foo\bar
+    rd foo
+)
+mkdir foo\bar\baz
+echo foo > foo\bar\brol
+rmdir /s /Q foo
+if not exist foo (
+    echo recursive rmdir succeeded
+) else (
+    rd foo\bar\baz
+    del foo\bar\brol
+    rd foo\bar
+    rd foo
+)
 
 echo -----------Testing Errorlevel-----------
 rem nt 4.0 doesn't really support a way of setting errorlevel, so this is weak
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 235d552..3ddd824 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -166,6 +166,8 @@ file not removed
 non-empty dir not removed
 0
 non-empty dir not removed
+recursive rmdir succeeded
+recursive rmdir succeeded
 -----------Testing Errorlevel-----------
 1
 errorlevel just right, good
-- 
1.7.6




More information about the wine-patches mailing list