summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2006-03-21 11:12:27 (GMT)
commit86ca5531ac0818f99726ba9ad478e277cd5d6e94 (patch)
treecb78904bbef94025a4f19257afc9211ee618e8ce /tests/clock.test
parentd4070e928ea23c067c492b5e594d206a76d9b3d5 (diff)
downloadtcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.zip
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.gz
tcl-86ca5531ac0818f99726ba9ad478e277cd5d6e94.tar.bz2
Use test constraints properly instead of looking in tcl_platform
Consistent method of calling test constraints, and (try to) move constraint setup to the top of the test file
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test27
1 files changed, 11 insertions, 16 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 6674fe4..d6c44ab 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -11,30 +11,25 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: clock.test,v 1.60 2005/11/28 15:37:19 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.61 2006/03/21 11:12:28 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
namespace import -force ::tcltest::*
}
-if { $::tcl_platform(platform) eq {windows} } {
- if { [catch { package require registry 1.1 }] } {
-
+if {[testConstraint win]} {
+ if {[catch {package require registry 1.1}]} {
# HIDEOUS KLUDGE: [package require registry 1.1] has failed.
# This failure likely means that we're running in Tcl's build
# directory instead of the install directory. We recover by
# trying to load tclreg*.dll directly.
-
- if { [catch {
- load [lindex \
- [glob -directory \
- [file join \
- [pwd] \
- [file dirname [info nameofexecutable]]] \
- tclReg*.dll] \
- 0] registry
- }] } {
+
+ if {[catch {
+ load [lindex [glob -directory \
+ [file join [pwd] [file dirname [info nameofexecutable]]] \
+ tclReg*.dll] 0] registry
+ }]} then {
# Still no registry!
namespace eval ::tcl::clock [set NoRegistry {}]
}
@@ -42,9 +37,9 @@ if { $::tcl_platform(platform) eq {windows} } {
}
package require msgcat 1.4
-::tcltest::testConstraint detroit \
+testConstraint detroit \
[expr {![catch {clock format 0 -timezone :America/Detroit -format %z}]}]
-::tcltest::testConstraint y2038 \
+testConstraint y2038 \
[expr {[clock format 2158894800 -format %z -timezone :America/Detroit] eq {-0400}}]
# TEST PLAN