Frédéric Delanoy : cmd/tests: Add basic rmdir tests.

Alexandre Julliard julliard at winehq.org
Tue Jul 12 13:47:10 CDT 2011


Module: wine
Branch: master
Commit: b37d39e35176cea7d9413e8195ca3069ce52d663
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b37d39e35176cea7d9413e8195ca3069ce52d663

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Mon Jul 11 23:34:08 2011 +0200

cmd/tests: Add basic rmdir tests.

---

 programs/cmd/tests/test_builtins.cmd     |   33 ++++++++++++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   12 ++++++++++
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index f4cc35a..347786d 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -225,6 +225,39 @@ if not exist foo (
     rmdir foo
 )
 
+echo ----------- Testing rmdir -----------
+call :setError 0
+rem rd and rmdir are synonymous
+mkdir foobar
+rmdir foobar
+echo %ErrorLevel%
+if not exist foobar echo dir removed
+mkdir foobar
+rd foobar
+echo %ErrorLevel%
+if not exist foobar echo dir removed
+rem Removing non-existent directory
+rmdir foobar
+echo %ErrorLevel%
+rem Removing single-level directories
+echo > foo
+rmdir foo
+echo %ErrorLevel%
+if exist foo echo file not removed
+del foo
+mkdir foo
+echo > foo\bar
+rmdir foo
+echo %ErrorLevel%
+if exist foo echo non-empty dir not removed
+del foo\bar
+mkdir foo\bar
+rmdir foo
+echo %ErrorLevel%
+if exist foo echo non-empty dir not removed
+rmdir foo\bar
+rmdir foo
+
 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
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index cfbc776..2e2bf84 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -124,6 +124,18 @@ dir created
 @todo_wine at ok, foo created
 @todo_wine at 1
 @todo_wine at ok, foo\bar created
+----------- Testing rmdir -----------
+0
+dir removed
+0
+dir removed
+0
+0
+file not removed
+0
+non-empty dir not removed
+0
+non-empty dir not removed
 -----------Testing Errorlevel-----------
 1
 errorlevel just right, good




More information about the wine-cvs mailing list