summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2005-07-15 22:32:10 (GMT)
committerKevin B Kenny <kennykb@acm.org>2005-07-15 22:32:10 (GMT)
commit17e8b8c78b5e27af69840be8b58596569f0f76e9 (patch)
treef4f327c96f30c6ee6facef575583b231fed32517 /tests
parentd70bdad3a4f08813f469ec8657f35f9096d3f454 (diff)
downloadtcl-17e8b8c78b5e27af69840be8b58596569f0f76e9.zip
tcl-17e8b8c78b5e27af69840be8b58596569f0f76e9.tar.gz
tcl-17e8b8c78b5e27af69840be8b58596569f0f76e9.tar.bz2
Bug 1237907
Diffstat (limited to 'tests')
-rw-r--r--tests/clock.test56
1 files changed, 55 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 4981d96..b8c864d 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.55 2005/05/10 18:34:56 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.56 2005/07/15 22:32:24 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -35411,6 +35411,60 @@ test clock-48.1 {Bug 1185933: 'i' destroyed by clock init} -setup {
interp delete child
} -result {0 12345}
+test clock-49.1 {regression test - localtime with negative arg (Bug 1237907)} \
+ -body {
+ list [catch {
+ clock format -86400 -timezone :localtime -format %Y
+ } result] $result
+ } \
+ -match regexp \
+ -result {0 1969|1 {localtime failed \(clock value may be too large/small to represent\)}}
+
+test clock-49.2 {regression test - missing time zone file (Bug 1237907)} \
+ -constraints win \
+ -setup {
+ # override the registry so that the test takes place in New York time
+ namespace eval ::tcl::clock {
+ namespace import -force ::testClock::registry
+ }
+ if { [info exists env(TZ)] } {
+ set oldTZ $env(TZ)
+ unset env(TZ)
+ }
+ if { [info exists env(TCL_TZ)] } {
+ set oldTclTZ $env(TCL_TZ)
+ unset env(TCL_TZ)
+ }
+ # make it so New York time is a missing file
+ dict set ::tcl::clock::WinZoneInfo \
+ {-18000 0 3600 0 10 0 5 2 0 0 0 0 4 0 1 2 0 0 0} \
+ :No/Such/File
+ ::tcl::clock::ClearCaches
+ } \
+ -body {
+ list [::tcl::clock::GuessWindowsTimeZone] \
+ [clock format 0 -locale system -format "%X %Z"] \
+ [clock format -86400 -format "%Y"]
+ } \
+ -cleanup {
+ # restore the registry and environment
+ namespace eval ::tcl::clock {
+ rename registry {}
+ }
+ if { [info exists oldTclTZ] } {
+ set env(TCL_TZ) $oldTclTZ
+ }
+ if { [info exists oldTZ] } {
+ set env(TZ) $oldTZ
+ }
+ # put New York back on the map
+ dict set ::tcl::clock::WinZoneInfo \
+ {-18000 0 3600 0 10 0 5 2 0 0 0 0 4 0 1 2 0 0 0} \
+ :America/New_York
+ ::tcl::clock::ClearCaches
+ } \
+ -result {<-0500>+05:00:00<-0400>+04:00:00,M4.1.0/02:00:00,M10.5.0/02:00:00 { 7:00:00 PM -0500} 1969}
+
# cleanup
namespace delete ::testClock