summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2004-10-22 14:27:38 (GMT)
committerKevin B Kenny <kennykb@acm.org>2004-10-22 14:27:38 (GMT)
commit9f2e0752a6f6ab07ff0b2411c9a945ba52804aff (patch)
tree34ad284fc57b23779e572af23ea0751968d1f54c /tests/clock.test
parentca054492e8f0b534d337d8bbb1bedab26f3942a1 (diff)
downloadtcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.zip
tcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.tar.gz
tcl-9f2e0752a6f6ab07ff0b2411c9a945ba52804aff.tar.bz2
* library/clock.tcl: Fixed a typo where the fallback time zone
became ::localtime instead of :localtime. Fixed a bug where time zone names containing hyphens could not be loaded. Thanks to Todd M. Helfter <tmh@jumpgate.itsp.purdue.edu> for finding these bugs. * tests/clock.test: Added regression test cases that covers both bugs.
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index dae01a2..f0752bc 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.46 2004/10/04 15:30:25 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.47 2004/10/22 14:27:39 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -35301,6 +35301,28 @@ test clock-43.1 {regression test - mktime returning -1} \
} \
-result {-1}
+test clock-44.1 {regression test - time zone name containing hyphen } \
+ -setup {
+ if { [info exists env(TZ)] } {
+ set oldTZ $env(TZ)
+ }
+ set env(TZ) US/East-Indiana
+ } \
+ -body {
+ clock format 1098466496 -format %H:%M:%S%z -timezone US/East-Indiana
+ } \
+ -cleanup {
+ if { [info exists oldTZ] } {
+ set env(TZ) $oldTZ
+ unset oldTZ
+ } else {
+ unset env(TZ)
+ }
+ } \
+ -result {12:34:56-0500}
+
+
+
# cleanup
namespace delete ::testClock