=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd/tests: Add RENAME tests.

Alexandre Julliard julliard at winehq.org
Thu Sep 15 12:34:53 CDT 2011


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

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Wed Sep 14 23:39:10 2011 +0200

cmd/tests: Add RENAME tests.

---

 programs/cmd/tests/test_builtins.cmd     |   32 +++++++++++++++++++++++++++++-
 programs/cmd/tests/test_builtins.cmd.exp |   12 ++++++++++-
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index cd30e4f..35ab181 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -879,7 +879,37 @@ rmdir "foo:"
 cd ..
 rmdir "foo bar"
 
-echo ----------- Testing mkdir -----------
+echo ------------ Testing rename ------------
+mkdir foobar & cd foobar
+echo ... ren and rename are synonymous ...
+echo > foo
+rename foo bar
+if exist foo echo foo should be renamed!
+if exist bar echo foo renamed to bar
+ren bar foo
+if exist bar echo bar should be renamed!
+if exist foo echo bar renamed to foo
+echo ... name collision ...
+echo foo>foo
+echo bar>bar
+ren foo bar 2> nul
+type foo
+type bar
+rem no-op
+ren foo foo
+mkdir baz
+ren foo baz\abc
+echo ... rename in other directory ...
+if not exist baz\abc (
+    echo rename impossible in other directory
+    if exist foo echo original file still present
+) else (
+    echo shouldn't rename in other directory!
+    if not exist foo echo original file not present anymore
+)
+cd .. & rd /s/q foobar
+
+echo ------------ Testing mkdir ------------
 call :setError 0
 echo ... md and mkdir are synonymous ...
 mkdir foobar
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 19536fe..31b1780 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -594,7 +594,17 @@ r.test not found after delete, good
 del /q * succeeded on file1
 del /q * succeeded on file2.dat
 ------------ Testing del /s --------------
------------ Testing mkdir -----------
+------------ Testing rename ------------
+... ren and rename are synonymous ...
+foo renamed to bar
+bar renamed to foo
+... name collision ...
+foo
+bar
+... rename in other directory ...
+ at todo_wine@rename impossible in other directory
+ at todo_wine@original file still present
+------------ Testing mkdir ------------
 ... md and mkdir are synonymous ...
 0
 0




More information about the wine-cvs mailing list