Update of /cvsroot/tclresource/Extras/Tests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4211
Modified Files:
DeleteCmd.test
Log Message:
2 more tests with protected res or map
Index: DeleteCmd.test
===================================================================
RCS file: /cvsroot/tclresource/Extras/Tests/DeleteCmd.test,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- DeleteCmd.test 6 Sep 2004 20:58:49 -0000 1.2
+++ DeleteCmd.test 7 Sep 2004 05:18:06 -0000 1.3
@@ -82,6 +82,23 @@
} -cleanup $CLEANUP -returnCodes error -match glob \
-result "you must specify either -id or -name or both"
+ test ResourceDelete-1-7 {Delete a protected resource} -setup $SETUP -body {
+ resource write -id 128 -name "Hello1" -file $rid TEXT "Hello1"
+ # Set the resProtected flag (= 8)
+ resource attributes $rid -id 128 TEXT 8
+ resource delete -id 128 -file $rid TEXT
+ } -cleanup $CLEANUP -returnCodes error -match glob \
+ -result "resource cannot be deleted: it is protected."
+
+ test ResourceDelete-1-8 {Delete resource in read-only map} -setup {
+ set rid [resource open $resfileDF]
+ } -body {
+ resource delete -id 128 -file $rid TEXT
+ } -cleanup {
+ resource close $rid
+ } -returnCodes error -match glob \
+ -result "cannot delete from resource file *, it was opened read only"
+
# Cleanup
::tcltest::cleanupTests
}
|