summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-08-17 21:27:41 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-08-17 21:27:41 (GMT)
commit2d51756d2fb2a61608c90343aeca6f945b3cd381 (patch)
treec7b25a88d58f691dc9196af50628664ec53763cb /tests/clock.test
parent5b8ceaef9457a0e83b4489ca281eddf6d04ba1c7 (diff)
downloadtcl-2d51756d2fb2a61608c90343aeca6f945b3cd381.zip
tcl-2d51756d2fb2a61608c90343aeca6f945b3cd381.tar.gz
tcl-2d51756d2fb2a61608c90343aeca6f945b3cd381.tar.bz2
fixed bad clock test, removed duplicated code in Tcl_Finalize
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test38
1 files changed, 16 insertions, 22 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 3ad928e..4911726 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -11,7 +11,7 @@
# 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.57 2005/08/12 23:55:28 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.58 2005/08/17 21:27:41 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -35329,26 +35329,8 @@ test clock-42.1 {regression test - %z in :localtime when west of Greenwich } \
} \
-result {-0500}
-test clock-43.1 {regression test - mktime returning -1} \
- -setup {
- if { [info exists env(TZ)] } {
- set oldTZ $env(TZ)
- }
- set env(TZ) UTC0
- } \
- -body {
- clock scan 1969-12-31T23:59:59 -format %Y-%m-%dT%T -timezone :localtime
- } \
- -cleanup {
- if { [info exists oldTZ] } {
- set env(TZ) $oldTZ
- unset oldTZ
- } else {
- unset env(TZ)
- }
- } \
- -result {-1}
-
+# 43.1 was a bad test - mktime returning -1 is an error according to posix.
+
test clock-44.1 {regression test - time zone name containing hyphen } \
-setup {
if { [info exists env(TZ)] } {
@@ -35471,12 +35453,24 @@ test clock-50.1 {format / scan -1 as a local time} {
[clock format -1 -format %Y%m%d%H%M%S -timezone :localtime] \
-format %Y%m%d%H%M%S -timezone :localtime
} result]} {
- if { [regexp "clock value too" $result] } {
+ if { [regexp " too large" $result] } {
set result -1
}
}
set result
} -1
+test clock-50.2 {format / scan -2 as a local time} {
+ if {[catch {
+ clock scan \
+ [clock format -2 -format %Y%m%d%H%M%S -timezone :localtime] \
+ -format %Y%m%d%H%M%S -timezone :localtime
+ } result]} {
+ if { [regexp " too large" $result] } {
+ set result -2
+ }
+ }
+ set result
+} -2
# cleanup