Skip to content

Commit

Permalink
make clock tests system-TZ independent
Browse files Browse the repository at this point in the history
  • Loading branch information
sebres committed Mar 14, 2024
1 parent a3c9a12 commit 6eb48af
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions tests/clock.test
Original file line number Diff line number Diff line change
Expand Up @@ -36280,27 +36280,27 @@ test clock-34.18.5 {clock scan, ISO 8601 extended date time with UTC TZ} {
} "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"]
set time [clock scan "31 Jan 14 23:59:59 -0100" -gmt true]
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"]
set time [clock scan "31 Jan 14 23:59:59 +0100" -gmt true]
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]
set time [clock scan "23:59:59 -0100" -base 0 -gmt true]
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]
set time [clock scan "23:59:59 +0100" -base 0 -gmt true]
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"]
set time [clock scan "Mon, 30 Jun 2014 23:59:59 CEST" -gmt true]
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"]
set time [clock scan "Fri, 31 Jan 2014 23:59:59 CET" -gmt true]
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)} {
Expand All @@ -36312,11 +36312,11 @@ test clock-34.20.8 {clock scan tests (relspec, day unit not TZ)} {
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]
set time [clock scan "10:59 pm CET" -base 2000000 -gmt true]
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]
set time [clock scan "10:59 pm +0100" -base 2000000 -gmt true]
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)} {
Expand Down Expand Up @@ -36372,6 +36372,12 @@ test clock-34.20.19 {clock scan tests (no TZ)} {
test clock-34.20.20 {clock scan tests (TZ, TZ + 1day)} {
clock scan "00:00 GMT+1000 day" -base 100000000 -gmt 1
} 100015200
test clock-34.20.21 {clock scan tests (local date of base depends on given TZ, time apllied to different day)} {
list [clock scan "23:59:59 -0100" -base 0 -timezone :CET] \
[clock scan "23:59:59 -0100" -base 0 -gmt 1] \
[clock scan "23:59:59 -0100" -base 0 -timezone -1400] \
[clock scan "23:59:59 -0100" -base 0 -timezone :Pacific/Apia]
} {89999 89999 3599 3599}


# CLOCK SCAN REAL TESTS
Expand Down

0 comments on commit 6eb48af

Please sign in to comment.