summaryrefslogtreecommitdiffstats
path: root/tests/tcltest.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-06-06 18:44:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-06-06 18:44:43 (GMT)
commit63c1ccd8a66274ade947443679935e29d18c8f36 (patch)
tree56fbc7eb05a792b7503efe42196daf145f440063 /tests/tcltest.test
parent7710d5c62d5217f563468a0e595c9f71240f351b (diff)
downloadtcl-63c1ccd8a66274ade947443679935e29d18c8f36.zip
tcl-63c1ccd8a66274ade947443679935e29d18c8f36.tar.gz
tcl-63c1ccd8a66274ade947443679935e29d18c8f36.tar.bz2
* tests/io.test: Fixed up namespace variable resolution issues
revealed by running test suite with "-singleproc 1". * doc/tcltest.n: * library/tcltest/tcltest.tcl: * tests/tcltest.test: Several updates to tcltest. 1) changed to lazy initialization of test constraints 2) deprecated [initConstraintsHook] 3) repaired badly broken [limitConstraints]. [Patch 512214, Bug 558742, Bug 461000]
Diffstat (limited to 'tests/tcltest.test')
-rwxr-xr-xtests/tcltest.test89
1 files changed, 47 insertions, 42 deletions
diff --git a/tests/tcltest.test b/tests/tcltest.test
index b876367..3bb2d36 100755
--- a/tests/tcltest.test
+++ b/tests/tcltest.test
@@ -6,7 +6,7 @@
# Copyright (c) 2000 by Ajuba Solutions
# All rights reserved.
#
-# RCS: @(#) $Id: tcltest.test,v 1.23 2002/06/05 01:12:38 dgp Exp $
+# RCS: @(#) $Id: tcltest.test,v 1.24 2002/06/06 18:44:44 dgp Exp $
if {[catch {package require tcltest 2.1}]} {
puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
@@ -213,7 +213,7 @@ test tcltest-4.6 {tcltest::skip} {
}
# -constraints, -limitconstraints, [testConstraint],
-# [constraintsSpecified], [constraintList], [limitConstraints]
+# $constraintsSpecified, [limitConstraints]
test tcltest-5.1 {tcltest -constraints 'knownBug'} {unixOrPc} {
set result [catch {exec [interpreter] test.tcl -constraints knownBug -verbose 'ps'} msg]
list $result [regexp a-1.0 $msg] [regexp b-1.0 $msg] [regexp c-1.0 $msg] \
@@ -236,29 +236,31 @@ test tcltest-5.3 {testConstraint - constraint empty (tcltest::safeFetch)} {
-cleanup {unset ::tcltest::testConstraints(tcltestFakeConstraint)}
}
-test tcltest-5.4 {tcltest::constraintsSpecified} {
- -setup {
- set constraintlist $::tcltest::constraintsSpecified
- set ::tcltest::constraintsSpecified {}
- }
- -body {
- set r1 $::tcltest::constraintsSpecified
- testConstraint tcltestFakeConstraint1 1
- set r2 $::tcltest::constraintsSpecified
- testConstraint tcltestFakeConstraint2 1
- set r3 $::tcltest::constraintsSpecified
- list $r1 $r2 $r3
- }
- -result {{} tcltestFakeConstraint1 {tcltestFakeConstraint1 tcltestFakeConstraint2}}
- -cleanup {
- set ::tcltest::constraintsSpecified $constraintlist
- unset ::tcltest::testConstraints(tcltestFakeConstraint1)
- unset ::tcltest::testConstraints(tcltestFakeConstraint2)
- }
-}
-
-test tcltest-5.5 {tcltest::constraintList} \
- -constraints {!$::tcltest::testConstraints(singleTestInterp)} \
+# Removed this test of internals of tcltest. Those internals have changed.
+#test tcltest-5.4 {tcltest::constraintsSpecified} {
+# -setup {
+# set constraintlist $::tcltest::constraintsSpecified
+# set ::tcltest::constraintsSpecified {}
+# }
+# -body {
+# set r1 $::tcltest::constraintsSpecified
+# testConstraint tcltestFakeConstraint1 1
+# set r2 $::tcltest::constraintsSpecified
+# testConstraint tcltestFakeConstraint2 1
+# set r3 $::tcltest::constraintsSpecified
+# list $r1 $r2 $r3
+# }
+# -result {{} tcltestFakeConstraint1 {tcltestFakeConstraint1 tcltestFakeConstraint2}}
+# -cleanup {
+# set ::tcltest::constraintsSpecified $constraintlist
+# unset ::tcltest::testConstraints(tcltestFakeConstraint1)
+# unset ::tcltest::testConstraints(tcltestFakeConstraint2)
+# }
+#}
+
+test tcltest-5.5 {InitConstraints: list of built-in constraints} \
+ -constraints {!singleTestInterp} \
+ -setup {tcltest::InitConstraints} \
-body { lsort [array names ::tcltest::testConstraints] } \
-result [lsort {
95 98 asyncPipeClose eformat emptyTest hasIsoLocale interactive knownBug
@@ -268,23 +270,26 @@ test tcltest-5.5 {tcltest::constraintList} \
unixOrWin userInteraction win winCrash winOnly
}]
-test tcltest-5.6 {tcltest::limitConstraints} {
- -setup {
- set keeplc $::tcltest::limitConstraints
- set keepkb [testConstraint knownBug]
- }
- -body {
- set r1 [limitConstraints]
- set r2 [limitConstraints knownBug]
- set r3 [limitConstraints]
- list $r1 $r2 $r3
- }
- -cleanup {
- limitConstraints $keeplc
- testConstraint knownBug $keepkb
- }
- -result {false knownBug knownBug}
-}
+# Removed this broken test. Its usage of [limitConstraints] was not
+# in agreement with the documentation. [limitConstraints] is supposed
+# to take an optional boolean argument, and "knownBug" ain't no boolean!
+#test tcltest-5.6 {tcltest::limitConstraints} {
+# -setup {
+# set keeplc $::tcltest::limitConstraints
+# set keepkb [testConstraint knownBug]
+# }
+# -body {
+# set r1 [limitConstraints]
+# set r2 [limitConstraints knownBug]
+# set r3 [limitConstraints]
+# list $r1 $r2 $r3
+# }
+# -cleanup {
+# limitConstraints $keeplc
+# testConstraint knownBug $keepkb
+# }
+# -result {false knownBug knownBug}
+#}
# -outfile, -errfile, [outputChannel], [outputFile], [errorChannel], [errorFile]
set printerror [makeFile {