summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-04-20 03:50:19 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-04-20 03:50:19 (GMT)
commit7fd2b33d4eefd8711a3ef349cdd729da6bb7fa42 (patch)
treed0ba9924529bf511f1c6781402f4e976d456599a /tests
parent80464ee3b468bace581c7de7480928659a49c45a (diff)
downloadtcl-7fd2b33d4eefd8711a3ef349cdd729da6bb7fa42.zip
tcl-7fd2b33d4eefd8711a3ef349cdd729da6bb7fa42.tar.gz
tcl-7fd2b33d4eefd8711a3ef349cdd729da6bb7fa42.tar.bz2
* tests/clock.test (clock-59.1): Added a regression test for
military time zone input conversion. [Bug 1586828]. * generic/tclGetDate.y (MilitaryTable): Fixed an ancient bug where the military NZA time zones had the signs reversed [Bug 1586828].
Diffstat (limited to 'tests')
-rw-r--r--tests/clock.test40
1 files changed, 39 insertions, 1 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 0aa65b6..35af1f0 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.76 2007/04/20 02:46:32 kennykb Exp $
+# RCS: @(#) $Id: clock.test,v 1.77 2007/04/20 03:50:21 kennykb Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -36519,6 +36519,44 @@ test clock-58.1 {clock l10n - Japanese localisation} {*}{
-result {}
}
+test clock-59.1 {military time zones} {
+ set hour 0
+ set base [clock scan "20000101 000000" -format "%Y%m%d %H%M%S" -gmt 1]
+ set trouble {}
+ foreach {pzone mzone} {
+ Z Z A N B O C P D Q E R F S G T H U I V K W L X M Y
+ } {
+ catch {clock scan "20000101 000000 $pzone" \
+ -format "%Y%m%d %H%M%S %Z"} ps1
+ catch {clock scan "20000101 000000 $pzone"} ps2
+ catch {clock scan "20000101 000000 $mzone" \
+ -format "%Y%m%d %H%M%S %Z"} ms1
+ catch {clock scan "20000101 000000 $mzone"} ms2
+ if {$ps1 != $base - 3600 * $hour} {
+ lappend trouble [list pzone $pzone hour $hour ps1 is $ps1]
+ }
+ if {$ps2 != $base - 3600 * $hour} {
+ lappend trouble [list pzone $pzone ps2 is $ps2]
+ }
+ if {$ms1 != $base + 3600 * $hour} {
+ lappend trouble [list mzone $mzone ms1 is $ms1]
+ }
+ # S means 'seconds' and therefore isn't parsed as a time zone.
+ # Yet another ambiguity in the free-form scanner!
+ if {$mzone ne "S"} {
+ if {$ms2 != $base + 3600 * $hour} {
+ lappend trouble [list mzone $mzone ms2 is $ms2]
+ }
+ }
+ incr hour
+ }
+ join $trouble \n
+} {}
+
+
+
+
+
# cleanup
namespace delete ::testClock