summaryrefslogtreecommitdiffstats
path: root/tests/resource.test
diff options
context:
space:
mode:
authorjingham <jingham@noemail.net>1998-11-10 06:54:10 (GMT)
committerjingham <jingham@noemail.net>1998-11-10 06:54:10 (GMT)
commit8fbe8532d695edc81f615c66b8cd494f6bd56bd0 (patch)
tree71770a510a25e2c3cbb138639beb8a88005cb995 /tests/resource.test
parente3c04845583003a0742f88e1723a6bb318e64b83 (diff)
downloadtcl-8fbe8532d695edc81f615c66b8cd494f6bd56bd0.zip
tcl-8fbe8532d695edc81f615c66b8cd494f6bd56bd0.tar.gz
tcl-8fbe8532d695edc81f615c66b8cd494f6bd56bd0.tar.bz2
Fixed some tests which were failing on the Mac because of path differences. Added a test to the resource tests to cover the but I fixed. Fixed the stat test commands - the mac files were getting a leading :, which the test commands did not expect
FossilOrigin-Name: b66419d3df3fe52260d8cb71d5d83b3f77257b43
Diffstat (limited to 'tests/resource.test')
-rw-r--r--tests/resource.test25
1 files changed, 18 insertions, 7 deletions
diff --git a/tests/resource.test b/tests/resource.test
index c1d9a9e..91e93a4 100644
--- a/tests/resource.test
+++ b/tests/resource.test
@@ -9,7 +9,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: resource.test,v 1.2 1998/09/14 18:40:13 stanton Exp $
+# RCS: @(#) $Id: resource.test,v 1.3 1998/11/10 06:54:20 jingham Exp $
# Only run this test on Macintosh systems
if {$tcl_platform(platform) != "macintosh"} {
@@ -45,27 +45,38 @@ test resource-2.5 {resource open & close tests} {
} {}
test resource-2.6 {resource open & close tests} {
catch {file delete rsrc.file}
- testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"}
+ testWriteTextResource -rsrc fileRsrcName -file rsrc.file {A test string}
set id [resource open rsrc.file]
set result [string compare [resource open rsrc.file] $id]
+ lappend result [resource read TEXT fileRsrcName $id]
resource close $id
file delete rsrc.file
set result
-} {0}
+} {0 {A test string}}
test resource-2.7 {resource open & close tests} {
+ catch {file delete rsrc.file}
+ testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"}
+ set id [resource open rsrc.file r]
+ set result [catch {resource open rsrc.file w} mssg]
+ resource close $id
+ file delete rsrc.file
+ lappend result $mssg
+ set result
+} {1 {Resource already open with different permissions.}}
+test resource-2.8 {resource open & close tests} {
list [catch {resource close} msg] $msg
} {1 {wrong # args: should be "resource close resourceRef"}}
-test resource-2.8 {resource open & close tests} {
+test resource-2.9 {resource open & close tests} {
list [catch {resource close foo bar} msg] $msg
} {1 {wrong # args: should be "resource close resourceRef"}}
-test resource-2.9 {resource open & close tests} {
+test resource-2.10 {resource open & close tests} {
list [catch {resource close _bad_resource_} msg] $msg
} {1 {invalid resource file reference "_bad_resource_"}}
-test resource-2.10 {resource open & close tests} {
+test resource-2.11 {resource open & close tests} {
set result [catch {resource close System} mssg]
lappend result $mssg
} {1 {can't close "System" resource file}}
-test resource-2.11 {resource open & close tests} {
+test resource-2.12 {resource open & close tests} {
set result [catch {resource close application} mssg]
lappend result $mssg
} {1 {can't close "application" resource file}}