summaryrefslogtreecommitdiffstats
path: root/tests/resource.test
diff options
context:
space:
mode:
authorjingham <jingham>1998-11-10 06:54:11 (GMT)
committerjingham <jingham>1998-11-10 06:54:11 (GMT)
commit554f088073f47913899360f71b5da8d097b61c72 (patch)
tree71770a510a25e2c3cbb138639beb8a88005cb995 /tests/resource.test
parent0b7d54658da48c639f446247709d0f7677c52ba2 (diff)
downloadtcl-554f088073f47913899360f71b5da8d097b61c72.zip
tcl-554f088073f47913899360f71b5da8d097b61c72.tar.gz
tcl-554f088073f47913899360f71b5da8d097b61c72.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
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}}