Added ATTRIB tests to cmd/tests

EG Galano eg.galano at gmail.com
Fri Apr 2 01:27:31 CDT 2010


---
 programs/cmd/tests/test_builtins.cmd     |   32 ++++++++++++++++++++++++++++++
 programs/cmd/tests/test_builtins.cmd.exp |   11 ++++++++++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
index d596c18..fef6352 100644
--- a/programs/cmd/tests/test_builtins.cmd
+++ b/programs/cmd/tests/test_builtins.cmd
@@ -70,3 +70,35 @@ echo goto with a leading space worked
 if c==c goto dest3
 	:dest3
 echo goto with a leading tab worked
+
+echo -----------Testing ATTRIB-----------
+echo Creating test file: test_temp.txt
+echo This is a test file > test_temp.txt
+if %errorlevel% == 0 (echo File created successfully
+) else (
+  echo ATTRIB Unable to generate test file
+)
+echo Setting file as read-only
+attrib +R test_temp.txt
+if %errorlevel% == 0 (echo '+R' attribute seems to work
+) else (
+  echo Test failed)
+echo Removing 'R' from test_temp.txt
+attrib -R test_temp.txt
+if %errorlevel% == 0 ( echo '-R' attribute seems to work
+) else (
+  echo Test failed
+)
+echo Checking attributes of a file
+attrib test_temp.txt > NUL
+if %errorlevel% == 0 ( echo Checking a file's attributes seems to work
+) else (
+  echo Test failed
+)
+del test_temp.txt
+echo Checking attrib with no args
+attrib > NUL
+if %errorlevel% == 0 ( echo Attrib with no args seems to work
+) else (
+  echo Test failed
+)
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
index 306953b..052fc09 100644
--- a/programs/cmd/tests/test_builtins.cmd.exp
+++ b/programs/cmd/tests/test_builtins.cmd.exp
@@ -44,3 +44,14 @@ if /I seems to work
 goto with no leading space worked
 goto with a leading space worked
 goto with a leading tab worked
+-----------Testing ATTRIB-----------
+Creating test file: test_temp.txt
+File created successfully
+Setting file as read-only
+'+R' attribute seems to work
+Removing 'R' from test_temp.txt
+'-R' attribute seems to work
+Checking attributes of a file
+Checking a file's attributes seems to work
+Checking attrib with no args
+Attrib with no args seems to work
-- 
1.6.3.3


--=-lJOQiYWN2lFsjOkNVsjX--




More information about the wine-patches mailing list