summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-05-29 17:19:31 (GMT)
committersebres <sebres@users.sourceforge.net>2018-05-29 17:19:31 (GMT)
commitbacdc67e693100da3faef171a1b172ff2dee1fa5 (patch)
treed474669d8422e3b305f2bdfdcdcbb2b0c45ec0dc
parentfc3ea33681381656aab83ea5d6ae3dc3a0b33616 (diff)
downloadtcl-bacdc67e693100da3faef171a1b172ff2dee1fa5.zip
tcl-bacdc67e693100da3faef171a1b172ff2dee1fa5.tar.gz
tcl-bacdc67e693100da3faef171a1b172ff2dee1fa5.tar.bz2
Merge branch 'freescan_tz_fix'
-rw-r--r--tests/clock.test94
1 files changed, 94 insertions, 0 deletions
diff --git a/tests/clock.test b/tests/clock.test
index 05f82ee..2d39c1e 100644
--- a/tests/clock.test
+++ b/tests/clock.test
@@ -35911,6 +35911,100 @@ test clock-34.18 {clock scan, ISO 8601 point in time format} {
set time [clock scan "19921023T000000"]
clock format $time -format {%b %d, %Y %H:%M:%S}
} "Oct 23, 1992 00:00:00"
+test clock-34.20.1 {clock scan tests (-TZ)} {
+ set time [clock scan "31 Jan 14 23:59:59 -0100"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Feb 01,2014 00:59:59 GMT}
+test clock-34.20.2 {clock scan tests (+TZ)} {
+ set time [clock scan "31 Jan 14 23:59:59 +0100"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 31,2014 22:59:59 GMT}
+test clock-34.20.3 {clock scan tests (-TZ)} {
+ set time [clock scan "23:59:59 -0100" -base 0]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 02,1970 00:59:59 GMT}
+test clock-34.20.4 {clock scan tests (+TZ)} {
+ set time [clock scan "23:59:59 +0100" -base 0]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 01,1970 22:59:59 GMT}
+test clock-34.20.5 {clock scan tests (TZ)} {
+ set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jun 30,2014 21:59:59 GMT}
+test clock-34.20.6 {clock scan tests (TZ)} {
+ set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET"]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 31,2014 22:59:59 GMT}
+test clock-34.20.7 {clock scan tests (relspec, day unit not TZ)} {
+ set time [clock scan "23:59:59 +15 day" -base 2000000 -gmt true]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Feb 08,1970 23:59:59 GMT}
+test clock-34.20.8 {clock scan tests (relspec, day unit not TZ)} {
+ set time [clock scan "23:59:59 -15 day" -base 2000000 -gmt true]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 09,1970 23:59:59 GMT}
+test clock-34.20.9 {clock scan tests (merid and TZ)} {
+ set time [clock scan "10:59 pm CET" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 24,1970 21:59:00 GMT}
+test clock-34.20.10 {clock scan tests (merid and TZ)} {
+ set time [clock scan "10:59 pm +0100" -base 2000000]
+ clock format $time -format {%b %d,%Y %H:%M:%S %Z} -gmt true
+} {Jan 24,1970 21:59:00 GMT}
+test clock-34.20.11 {clock scan tests (complex TZ)} {
+ list [clock scan "GMT+1000" -base 100000000 -gmt 1] \
+ [clock scan "GMT+10" -base 100000000 -gmt 1] \
+ [clock scan "+1000" -base 100000000 -gmt 1]
+} [lrepeat 3 99964000]
+test clock-34.20.12 {clock scan tests (complex TZ)} {
+ list [clock scan "GMT-1000" -base 100000000 -gmt 1] \
+ [clock scan "GMT-10" -base 100000000 -gmt 1] \
+ [clock scan "-1000" -base 100000000 -gmt 1]
+} [lrepeat 3 100036000]
+test clock-34.20.13 {clock scan tests (complex TZ)} {
+ list [clock scan "GMT-0000" -base 100000000 -gmt 1] \
+ [clock scan "GMT+0000" -base 100000000 -gmt 1] \
+ [clock scan "GMT" -base 100000000 -gmt 1]
+} [lrepeat 3 100000000]
+test clock-34.20.14 {clock scan tests (complex TZ)} {
+ list [clock scan "CET+1000" -base 100000000 -gmt 1] \
+ [clock scan "CET-1000" -base 100000000 -gmt 1]
+} {99960400 100032400}
+test clock-34.20.15 {clock scan tests (complex TZ)} {
+ list [clock scan "CET-0000" -base 100000000 -gmt 1] \
+ [clock scan "CET+0000" -base 100000000 -gmt 1] \
+ [clock scan "CET" -base 100000000 -gmt 1]
+} [lrepeat 3 99996400]
+test clock-34.20.16 {clock scan tests (complex TZ)} {
+ list [clock format [clock scan "00:00 GMT+1000" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00 GMT+10" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00 +1000" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00" -base 100000000 -timezone +1000] -gmt 1]
+} [lrepeat 4 "Fri Mar 02 14:00:00 GMT 1973"]
+test clock-34.20.17 {clock scan tests (complex TZ)} {
+ list [clock format [clock scan "00:00 GMT+0100" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00 GMT+01" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00 GMT+1" -base 100000000 -gmt 1] -gmt 1] \
+ [clock format [clock scan "00:00" -base 100000000 -timezone +0100] -gmt 1]
+} [lrepeat 4 "Fri Mar 02 23:00:00 GMT 1973"]
+test clock-34.20.18 {clock scan tests (no TZ)} {
+ list [clock scan "1000days" -base 100000000 -gmt 1] \
+ [clock scan "1000 days" -base 100000000 -gmt 1] \
+ [clock scan "+1000days" -base 100000000 -gmt 1] \
+ [clock scan "+1000 days" -base 100000000 -gmt 1] \
+ [clock scan "GMT +1000 days" -base 100000000 -gmt 1] \
+ [clock scan "00:00 GMT +1000 days" -base 100000000 -gmt 1]
+} [lrepeat 6 186364800]
+test clock-34.20.19 {clock scan tests (no TZ)} {
+ list [clock scan "-1000days" -base 100000000 -gmt 1] \
+ [clock scan "-1000 days" -base 100000000 -gmt 1] \
+ [clock scan "GMT -1000days" -base 100000000 -gmt 1] \
+ [clock scan "00:00 GMT -1000 days" -base 100000000 -gmt 1] \
+} [lrepeat 4 13564800]
+test clock-34.20.20 {clock scan tests (TZ, TZ + 1day)} {
+ clock scan "00:00 GMT+1000 day" -base 100000000 -gmt 1
+} 100015200
+
# CLOCK SCAN REAL TESTS
# We use 5am PST, 31-12-1999 as the base for these scans because irrespective