summaryrefslogtreecommitdiffstats
path: root/tests
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
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')
-rw-r--r--tests/pkgMkIndex.test16
-rw-r--r--tests/resource.test25
2 files changed, 26 insertions, 15 deletions
diff --git a/tests/pkgMkIndex.test b/tests/pkgMkIndex.test
index a91b158..abec11c 100644
--- a/tests/pkgMkIndex.test
+++ b/tests/pkgMkIndex.test
@@ -8,7 +8,7 @@
# Copyright (c) 1998 by Scriptics Corporation.
# All rights reserved.
#
-# RCS: @(#) $Id: pkgMkIndex.test,v 1.2 1998/10/30 23:02:03 welch Exp $
+# RCS: @(#) $Id: pkgMkIndex.test,v 1.3 1998/11/10 06:54:11 jingham Exp $
if {[string compare test [info procs test]] == 1} then {source defs}
@@ -279,7 +279,7 @@ test pkgMkIndex-2.1 {simple package} {
test pkgMkIndex-2.2 {simple package - use -direct} {
runIndex -direct pkg simple.tcl
-} {0 {{simple:1.0 {source pkg/simple.tcl}}}}
+} "0 {{simple:1.0 {source [file join pkg simple.tcl]}}}"
test pkgMkIndex-3.1 {simple package with global symbols} {
runIndex pkg global.tcl
@@ -291,8 +291,8 @@ test pkgMkIndex-4.1 {split package} {
test pkgMkIndex-4.2 {split package - direct loading} {
runIndex -direct pkg pkg2_a.tcl pkg2_b.tcl
-} {0 {{pkg2:1.0 {source pkg/pkg2_a.tcl
-source pkg/pkg2_b.tcl}}}}
+} "0 {{pkg2:1.0 {source [file join pkg pkg2_a.tcl]
+source [file join pkg pkg2_b.tcl]}}}"
# This will fail, with "direct1" procedures in the list of procedures
# provided by std.
@@ -310,7 +310,7 @@ test pkgMkIndex-6.1 {pkg1 requires pkg3} {
test pkgMkIndex-6.2 {pkg1 requires pkg3 - use -direct} {
runIndex -direct pkg pkg1.tcl pkg3.tcl
-} {0 {{pkg1:1.0 {source pkg/pkg1.tcl}} {pkg3:1.0 {source pkg/pkg3.tcl}}}}
+} "0 {{pkg1:1.0 {source [file join pkg pkg1.tcl]}} {pkg3:1.0 {source [file join pkg pkg3.tcl]}}}"
test pkgMkIndex-7.1 {pkg4 uses pkg3} {
runIndex pkg pkg4.tcl pkg3.tcl
@@ -318,7 +318,7 @@ test pkgMkIndex-7.1 {pkg4 uses pkg3} {
test pkgMkIndex-7.2 {pkg4 uses pkg3 - use -direct} {
runIndex -direct pkg pkg4.tcl pkg3.tcl
-} {0 {{pkg3:1.0 {source pkg/pkg3.tcl}} {pkg4:1.0 {source pkg/pkg4.tcl}}}}
+} "0 {{pkg3:1.0 {source [file join pkg pkg3.tcl]}} {pkg4:1.0 {source [file join pkg pkg4.tcl]}}}"
test pkgMkIndex-8.1 {pkg5 uses pkg2} {
runIndex pkg pkg5.tcl pkg2_a.tcl pkg2_b.tcl
@@ -326,8 +326,8 @@ test pkgMkIndex-8.1 {pkg5 uses pkg2} {
test pkgMkIndex-8.2 {pkg5 uses pkg2 - use -direct} {
runIndex -direct pkg pkg5.tcl pkg2_a.tcl pkg2_b.tcl
-} {0 {{pkg2:1.0 {source pkg/pkg2_a.tcl
-source pkg/pkg2_b.tcl}} {pkg5:1.0 {source pkg/pkg5.tcl}}}}
+} "0 {{pkg2:1.0 {source [file join pkg pkg2_a.tcl]
+source [file join pkg pkg2_b.tcl]}} {pkg5:1.0 {source [file join pkg pkg5.tcl]}}}"
test pkgMkIndex-9.1 {circular packages} {
runIndex pkg circ1.tcl circ2.tcl circ3.tcl
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}}