summaryrefslogtreecommitdiffstats
path: root/tests/clock.test
diff options
context:
space:
mode:
authormax <max@tclers.tk>2011-10-18 13:03:42 (GMT)
committermax <max@tclers.tk>2011-10-18 13:03:42 (GMT)
commitda6099c4aee8ad8a537e6dc5354e8bbe32913dac (patch)
treebb5a3063c8a46877d555ead210b5cbd650b4a0f7 /tests/clock.test
parent918a89f9a97e677296ce27561f83105823452747 (diff)
downloadtcl-da6099c4aee8ad8a537e6dc5354e8bbe32913dac.zip
tcl-da6099c4aee8ad8a537e6dc5354e8bbe32913dac.tar.gz
tcl-da6099c4aee8ad8a537e6dc5354e8bbe32913dac.tar.bz2
Don't cache the system timezone when it was derived from TCL_TZ or TZ.
Diffstat (limited to 'tests/clock.test')
-rw-r--r--tests/clock.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 7937933..917543a 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -35895,6 +35895,39 @@ test clock-38.1 {regression - convertUTCToLocalViaC - east of Greenwich} \
} \
-result {01:00:00}
+test clock-38.2 {make sure TZ is not cached after unset} \
+ -setup {
+ 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)
+ }
+ } \
+ -body {
+ set t1 [clock format 0]
+ # a time zone that is unlikely to anywhere
+ set env(TZ) "+04:20"
+ set t2 [clock format 0]
+ unset env(TZ)
+ set t3 [clock format 0]
+ expr {$t1 eq $t3 && $t1 ne $t2}
+ } \
+ -cleanup {
+ if { [info exists oldTZ] } {
+ set env(TZ) $oldTZ
+ unset oldTZ
+ }
+ if { [info exists oldTclTZ] } {
+ set env(TCL_TZ) $oldTclTZ
+ unset oldTclTZ
+ }
+ } \
+ -result 1
+
+
test clock-39.1 {regression - synonym timezones} {
clock format 0 -format {%H:%M:%S} -timezone :US/Eastern
} {19:00:00}