Module: wine Branch: master Commit: 3ce59f5dba4bcb26f8408d3bfe69111808d25529 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ce59f5dba4bcb26f8408d3bfe...
Author: Frédéric Delanoy frederic.delanoy@gmail.com Date: Wed Aug 24 12:53:21 2011 +0200
cmd/tests: Add attrib tests.
---
programs/cmd/tests/test_builtins.cmd | 61 ++++++++++++++++++++++++++++++ programs/cmd/tests/test_builtins.cmd.exp | 20 ++++++++++ 2 files changed, 81 insertions(+), 0 deletions(-)
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd index 668bea4..618a6c7 100644 --- a/programs/cmd/tests/test_builtins.cmd +++ b/programs/cmd/tests/test_builtins.cmd @@ -786,6 +786,67 @@ if not exist bar\baz (echo bar\baz removed) else echo bar\baz not removed! cd .. rd /s/q foobaz
+echo ------------ Testing attrib -------------- +rem FIXME Add tests for archive, hidden and system attributes + mixed attributes modifications +mkdir foobar & cd foobar +echo foo original contents> foo +attrib foo +echo > bar +echo ... read-only attribute +rem Read-only files cannot be altered or deleted, unless forced +attrib +R foo +attrib foo +dir /Ar /B +echo bar>> foo +type foo +del foo > NUL 2>&1 +if exist foo ( + echo Read-only file not deleted +) else ( + echo Should not delete read-only file! +) +del /F foo +if not exist foo ( + echo Read-only file forcibly deleted +) else ( + echo Should delete read-only file with del /F! + attrib -r foo + del foo +) +cd .. +rd /s/q foobar +echo ... recursive behaviour +mkdir foobar\baz & cd foobar +echo > level1 +echo > whatever +echo > baz\level2 +attrib baz\level2 +cd .. +attrib +R l*vel? /S > nul 2>&1 +cd foobar +attrib level1 +attrib baz\level2 +echo > bar +attrib bar +cd .. +rd /s/q foobar +echo ... folders processing +mkdir foobar +attrib foobar +cd foobar +mkdir baz +echo toto> baz\toto +attrib +r baz /s /d > nul 2>&1 +attrib baz +attrib baz\toto +echo lulu>>baz\toto +type baz\toto +echo > baz\lala +rem Oddly windows allows file creation in a read-only directory... +if exist baz\lala (echo file created in read-only dir) else echo file not created +cd .. +rd /s/q foobar + echo ------------ Testing CALL -------------- mkdir foobar & cd foobar rem External script diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp index 08a66eb..ae21f05 100644 --- a/programs/cmd/tests/test_builtins.cmd.exp +++ b/programs/cmd/tests/test_builtins.cmd.exp @@ -476,6 +476,26 @@ foo removed bar removed foobar removed bar\baz removed +------------ Testing attrib -------------- +@todo_wine@A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo +... read-only attribute +@todo_wine@A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo +foo +foo original contents +Read-only file not deleted +Read-only file forcibly deleted +... recursive behaviour +@todo_wine@A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2 +@todo_wine@A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1 +@todo_wine@A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2 +@todo_wine@A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar +... folders processing +@todo_wine@ @pwd@\foobar@or_broken@ @pwd@\foobar +@todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz +@todo_wine@A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto +toto +lulu +file created in read-only dir ------------ Testing CALL -------------- foo@space@ @todo_wine@foo 8