Commit 3ce59f5d authored by Frédéric Delanoy's avatar Frédéric Delanoy Committed by Alexandre Julliard

cmd/tests: Add attrib tests.

parent ca8c23f5
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment