hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 2ab29ff14258a7a7cd1323864e799458dc7c17c1
parent 2267e99b6271d132366ca1c128abc021a9954045
Author: Vlad-Stefan Harbuz <vlad@vladh.net>
Date:   Mon, 31 Jan 2022 15:28:17 +0100

correct tests, use new chrono::UTC

Signed-off-by: Vlad-Stefan Harbuz <vlad@vladh.net>
Signed-off-by: Byron Torres <b@torresjrjr.com>

Diffstat:
Mdatetime/arithmetic.ha | 166++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mdatetime/datetime.ha | 8++++----
Mdatetime/format.ha | 2+-
3 files changed, 88 insertions(+), 88 deletions(-)

diff --git a/datetime/arithmetic.ha b/datetime/arithmetic.ha @@ -439,7 +439,7 @@ fn absi(n: i64) i64 = { }; @test fn eq() void = { - const dt = new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 07, 0)!; + const dt = new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 0)!; const cases = [ ((-768, 01, 01, 03, 14, 07, 0), false), ((1, 1, 01, 14, 00, 00, 1234), false), @@ -451,7 +451,7 @@ fn absi(n: i64) i64 = { for (let i = 0z; i < len(cases); i += 1) { const c = cases[i].0; const expected = cases[i].1; - const case_dt = new(chrono::UTC_Z, 0, + const case_dt = new(chrono::UTC, 0, c.0, c.1, c.2, c.3, c.4, c.5, c.6)!; assert(eq(dt, case_dt) == expected, "equality comparison failed"); @@ -459,7 +459,7 @@ fn absi(n: i64) i64 = { }; @test fn is_after() void = { - const dt = new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 07, 0)!; + const dt = new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 0)!; const cases = [ ((-768, 01, 01, 03, 14, 07, 0), false), ((1, 1, 01, 14, 00, 00, 1234), false), @@ -472,7 +472,7 @@ fn absi(n: i64) i64 = { for (let i = 0z; i < len(cases); i += 1) { const c = cases[i].0; const expected = cases[i].1; - const case_dt = new(chrono::UTC_Z, 0, + const case_dt = new(chrono::UTC, 0, c.0, c.1, c.2, c.3, c.4, c.5, c.6)!; assert(is_after(case_dt, dt) == expected, "incorrect date ordering in is_after()"); @@ -480,7 +480,7 @@ fn absi(n: i64) i64 = { }; @test fn is_before() void = { - const dt = new(2022, 02, 04, 03, 14, 07, 0, 0, chrono::UTC_Z)!; + const dt = new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 0)!; const cases = [ ((-768, 01, 01, 03, 14, 07, 0), true), ((1, 1, 01, 14, 00, 00, 1234), true), @@ -493,7 +493,7 @@ fn absi(n: i64) i64 = { for (let i = 0z; i < len(cases); i += 1) { const c = cases[i].0; const expected = cases[i].1; - const case_dt = new(chrono::UTC_Z, 0, + const case_dt = new(chrono::UTC, 0, c.0, c.1, c.2, c.3, c.4, c.5, c.6)!; assert(is_before(case_dt, dt) == expected, "incorrect date ordering in is_before()"); @@ -503,8 +503,8 @@ fn absi(n: i64) i64 = { @test fn diff() void = { const cases = [ ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2022, 02, 16, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 15, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2022, 02, 16, 00, 00, 00, 0)!, period { years = 1, months = 1, @@ -513,8 +513,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2022, 03, 27, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 15, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2022, 03, 27, 00, 00, 00, 0)!, period { years = 1, months = 2, @@ -523,8 +523,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2022, 03, 14, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 15, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2022, 03, 14, 00, 00, 00, 0)!, period { years = 1, months = 1, @@ -533,16 +533,16 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2021, 01, 16, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 15, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 16, 00, 00, 00, 0)!, period { days = 1, ... }, ), ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2021, 01, 16, 01, 03, 02, 4)!, + new(chrono::UTC, 0, 2021, 01, 15, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2021, 01, 16, 01, 03, 02, 4)!, period { days = 1, hours = 1, @@ -553,8 +553,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2021, 01, 15, 02, 03, 02, 2)!, - new(chrono::UTC_Z, 0, 2021, 01, 16, 01, 01, 02, 4)!, + new(chrono::UTC, 0, 2021, 01, 15, 02, 03, 02, 2)!, + new(chrono::UTC, 0, 2021, 01, 16, 01, 01, 02, 4)!, period { hours = 22, minutes = 58, @@ -563,8 +563,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 0500, 01, 01, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 3500, 01, 01, 00, 06, 00, 0)!, + new(chrono::UTC, 0, 0500, 01, 01, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 3500, 01, 01, 00, 06, 00, 0)!, period { years = 3000, minutes = 6, @@ -572,8 +572,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, -500, 01, 01, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2500, 01, 01, 00, 06, 00, 0)!, + new(chrono::UTC, 0, -500, 01, 01, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2500, 01, 01, 00, 06, 00, 0)!, period { years = 3000, minutes = 6, @@ -581,8 +581,8 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2000, 01, 01, 00, 00, 00, 0)!, - new(chrono::UTC_Z, 0, 2000, 01, 01, 00, 06, 00, 999999999)!, + new(chrono::UTC, 0, 2000, 01, 01, 00, 00, 00, 0)!, + new(chrono::UTC, 0, 2000, 01, 01, 00, 06, 00, 999999999)!, period { minutes = 6, nanoseconds = 999999999, @@ -590,18 +590,18 @@ fn absi(n: i64) i64 = { }, ), ( - new(chrono::UTC_Z, 0, 2000, 01, 01, 00, 06, 00, 999999999)!, - new(chrono::UTC_Z, 0, 2000, 01, 01, 00, 06, 01, 0)!, + new(chrono::UTC, 0, 2000, 01, 01, 00, 06, 00, 999999999)!, + new(chrono::UTC, 0, 2000, 01, 01, 00, 06, 01, 0)!, period { nanoseconds = 1, ... }, ), ( - new(chrono::UTC_Z, 0, -9000, 01, 01, 00, 06, 00, 999999999)!, - new(chrono::UTC_Z, 0, 9000, 01, 01, 00, 06, 01, 0)!, + new(chrono::UTC, 0, -4000, 01, 01, 00, 06, 00, 999999999)!, + new(chrono::UTC, 0, 4000, 01, 01, 00, 06, 01, 0)!, period { - years = 18000, + years = 8000, nanoseconds = 1, ... }, @@ -619,25 +619,25 @@ fn absi(n: i64) i64 = { @test fn diff_in_unit() void = { const cases = [ ( - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 2)!, - new(chrono::UTC_Z, 0, 2022, 01, 05, 13, 53, 30, 20)!, + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 2)!, + new(chrono::UTC, 0, 2022, 01, 05, 13, 53, 30, 20)!, (27, 328, 1427, 9993, 239834, 14390073, 863404409i64, (863404409i64 * time::SECOND) + 18), ), ( - new(chrono::UTC_Z, 0, 1994, 08, 28, 11, 20, 01, 2)!, - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 0)!, + new(chrono::UTC, 0, 1994, 08, 28, 11, 20, 01, 2)!, + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 0)!, (0, 0, 0, 1, 24, 1440, 86400i64, (86400i64 * time::SECOND) + 2), ), ( - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 0)!, - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 0)!, + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 0)!, + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 0)!, (0, 0, 0, 0, 0, 0, 0i64, 0i64), ), ( - new(chrono::UTC_Z, 0, -500, 01, 01, 00, 59, 01, 0)!, - new(chrono::UTC_Z, 0, 2000, 01, 01, 23, 01, 01, 0)!, + new(chrono::UTC, 0, -500, 01, 01, 00, 59, 01, 0)!, + new(chrono::UTC, 0, 2000, 01, 01, 23, 01, 01, 0)!, (2500, 30000, 130443, 913106, 913106 * 24 + 22, (913106 * 24 + 22) * 60 + 2, ((913106 * 24 + 22) * 60 + 2) * 60i64, @@ -669,149 +669,149 @@ fn absi(n: i64) i64 = { }; @test fn start_of() void = { - const dt = new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 2)!; + const dt = new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 2)!; assert(eq(start_of(unit::ERA, dt), - new(chrono::UTC_Z, 0, 01, 01, 01, 00, 00, 00, 0)!), + new(chrono::UTC, 0, 01, 01, 01, 00, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::YEAR, dt), - new(chrono::UTC_Z, 0, 1994, 01, 01, 00, 00, 00, 0)!), + new(chrono::UTC, 0, 1994, 01, 01, 00, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::MONTH, dt), - new(chrono::UTC_Z, 0, 1994, 08, 01, 00, 00, 00, 0)!), + new(chrono::UTC, 0, 1994, 08, 01, 00, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::WEEK, dt), - new(chrono::UTC_Z, 0, 1994, 08, 22, 00, 00, 00, 0)!), + new(chrono::UTC, 0, 1994, 08, 22, 00, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::DAY, dt), - new(chrono::UTC_Z, 0, 1994, 08, 27, 00, 00, 00, 0)!), + new(chrono::UTC, 0, 1994, 08, 27, 00, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::HOUR, dt), - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 00, 00, 0)!), + new(chrono::UTC, 0, 1994, 08, 27, 11, 00, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::MINUTE, dt), - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 00, 0)!), + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 00, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::SECOND, dt), - new(chrono::UTC_Z, 0, 1994, 08, 27, 11, 20, 01, 0)!), + new(chrono::UTC, 0, 1994, 08, 27, 11, 20, 01, 0)!), "invalid start_of() result"); assert(eq(start_of(unit::NANOSECOND, dt), dt), "invalid start_of() result"); }; @test fn add() void = { - const d = new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 07, 0)!; + const d = new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 0)!; const cases = [ ( period { years = 1, ... }, - new(chrono::UTC_Z, 0, 2023, 02, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2023, 02, 04, 03, 14, 07, 0)!, ), ( period { years = -23, ... }, - new(chrono::UTC_Z, 0, 1999, 02, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 1999, 02, 04, 03, 14, 07, 0)!, ), ( period { months = 2, ... }, - new(chrono::UTC_Z, 0, 2022, 04, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 04, 04, 03, 14, 07, 0)!, ), ( period { months = 11, ... }, - new(chrono::UTC_Z, 0, 2023, 01, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2023, 01, 04, 03, 14, 07, 0)!, ), ( period { months = -1, ... }, - new(chrono::UTC_Z, 0, 2022, 01, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 01, 04, 03, 14, 07, 0)!, ), ( period { months = -2, ... }, - new(chrono::UTC_Z, 0, 2021, 12, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2021, 12, 04, 03, 14, 07, 0)!, ), ( period { days = 3, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 07, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 07, 03, 14, 07, 0)!, ), ( period { days = 33, ... }, - new(chrono::UTC_Z, 0, 2022, 03, 09, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 03, 09, 03, 14, 07, 0)!, ), ( period { days = 333, ... }, - new(chrono::UTC_Z, 0, 2023, 01, 03, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2023, 01, 03, 03, 14, 07, 0)!, ), ( period { days = -2, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 02, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 02, 03, 14, 07, 0)!, ), ( period { days = -4, ... }, - new(chrono::UTC_Z, 0, 2022, 01, 31, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 01, 31, 03, 14, 07, 0)!, ), ( period { days = -1337, ... }, - new(chrono::UTC_Z, 0, 2018, 06, 08, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2018, 06, 08, 03, 14, 07, 0)!, ), ( period { hours = 1, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 04, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 04, 04, 14, 07, 0)!, ), ( period { hours = 24, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 05, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 05, 03, 14, 07, 0)!, ), ( period { hours = 25, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 05, 04, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 05, 04, 14, 07, 0)!, ), ( period { hours = 123456, ... }, - new(chrono::UTC_Z, 0, 2036, 03, 06, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2036, 03, 06, 03, 14, 07, 0)!, ), ( period { hours = -2, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 01, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 04, 01, 14, 07, 0)!, ), ( period { hours = -24, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 03, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2022, 02, 03, 03, 14, 07, 0)!, ), ( period { hours = -123456, ... }, - new(chrono::UTC_Z, 0, 2008, 01, 05, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2008, 01, 05, 03, 14, 07, 0)!, ), ( period { seconds = 2, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 09, 0)!, + new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 09, 0)!, ), ( period { seconds = 666666666, ... }, - new(chrono::UTC_Z, 0, 2043, 03, 22, 04, 25, 13, 0)!, + new(chrono::UTC, 0, 2043, 03, 22, 04, 25, 13, 0)!, ), ( period { seconds = -2, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 05, 0)!, + new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 05, 0)!, ), ( period { seconds = -666666666, ... }, - new(chrono::UTC_Z, 0, 2000, 12, 20, 02, 03, 01, 0)!, + new(chrono::UTC, 0, 2000, 12, 20, 02, 03, 01, 0)!, ), ( period { nanoseconds = 123, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 07, 123)!, + new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 123)!, ), ( period { nanoseconds = 1361661361461, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 36, 48, 661361461)!, + new(chrono::UTC, 0, 2022, 02, 04, 03, 36, 48, 661361461)!, ), ( period { nanoseconds = -1361661361461, ... }, - new(chrono::UTC_Z, 0, 2022, 02, 04, 02, 51, 25, 338638539)!, + new(chrono::UTC, 0, 2022, 02, 04, 02, 51, 25, 338638539)!, ), ( period { months = 1, seconds = -666666666, ... }, - new(chrono::UTC_Z, 0, 2001, 01, 17, 02, 03, 01, 0)!, + new(chrono::UTC, 0, 2001, 01, 17, 02, 03, 01, 0)!, ), ( period { months = 1, seconds = -666666666, ... }, - new(chrono::UTC_Z, 0, 2001, 01, 17, 02, 03, 01, 0)!, + new(chrono::UTC, 0, 2001, 01, 17, 02, 03, 01, 0)!, ), ( period { @@ -825,7 +825,7 @@ fn absi(n: i64) i64 = { nanoseconds = -8, ... }, - new(chrono::UTC_Z, 0, 2020, 11, 08, 22, 07, 59, 999999992)!, + new(chrono::UTC, 0, 2020, 11, 08, 22, 07, 59, 999999992)!, ), ( period { @@ -839,7 +839,7 @@ fn absi(n: i64) i64 = { nanoseconds = 8, ... }, - new(chrono::UTC_Z, 0, 2023, 04, 29, 08, 20, 14, 8)!, + new(chrono::UTC, 0, 2023, 04, 29, 08, 20, 14, 8)!, ), ( period { @@ -853,7 +853,7 @@ fn absi(n: i64) i64 = { nanoseconds = -34, ... }, - new(chrono::UTC_Z, 0, 2022, 12, 20, 11, 01, 27, 999999966)!, + new(chrono::UTC, 0, 2022, 12, 20, 11, 01, 27, 999999966)!, ), ( period { @@ -867,7 +867,7 @@ fn absi(n: i64) i64 = { nanoseconds = -86400000000000, ... }, - new(chrono::UTC_Z, 0, 2021, 01, 02, 16, 14, 07, 0)!, + new(chrono::UTC, 0, 2021, 01, 02, 16, 14, 07, 0)!, ), ]; for (let i = 0z; i < len(cases); i += 1) { @@ -887,19 +887,19 @@ fn absi(n: i64) i64 = { }; @test fn subtract() void = { - const d = new(chrono::UTC_Z, 0, 2022, 02, 04, 03, 14, 07, 0)!; + const d = new(chrono::UTC, 0, 2022, 02, 04, 03, 14, 07, 0)!; const cases = [ ( period { years = 1, ... }, - new(chrono::UTC_Z, 0, 2021, 02, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2021, 02, 04, 03, 14, 07, 0)!, ), ( period { months = 2, ... }, - new(chrono::UTC_Z, 0, 2021, 12, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2021, 12, 04, 03, 14, 07, 0)!, ), ( period { months = 14, ... }, - new(chrono::UTC_Z, 0, 2020, 12, 04, 03, 14, 07, 0)!, + new(chrono::UTC, 0, 2020, 12, 04, 03, 14, 07, 0)!, ), ]; for (let i = 0z; i < len(cases); i += 1) { diff --git a/datetime/datetime.ha b/datetime/datetime.ha @@ -52,10 +52,10 @@ fn init() datetime = datetime { // Creates a new datetime. When loc=void, defaults to chrono::local. // // // 0000 Jan 1st 00:00:00.000000000 +0000 UTC -// datetime::new(chrono::UTC_Z, 0); +// datetime::new(chrono::UTC, 0); // // // 2038 Jan 19th 03:14:07.000000618 +0000 UTC -// datetime::new(chrono::UTC_Z, 0, 2038, 01, 19, 03, 14, 07, 618); +// datetime::new(chrono::UTC, 0, 2038, 01, 19, 03, 14, 07, 618); // // // 2038 Jan 19th 02:00:00.000000000 +0100 Europe/Amsterdam // datetime::new(&olson::tz("Europe/Amsterdam"), 1 * time::HOUR, @@ -63,7 +63,7 @@ fn init() datetime = datetime { // // TODO: revise examples // -// zo is the zone offset from the normal timezone (in most cases, UTC_Z). For +// zo is the zone offset from the normal timezone (in most cases, UTC). For // example, the "Asia/Tokyo" timezone has a single zoffset of +9 hours, but the // "Australia/Sydney" timezone has zoffsets +10 hours and +11 hours, as they // observe Daylight Saving Time. @@ -305,7 +305,7 @@ export type method = enum uint { }; @test fn clone() void = { - let d0 = datetime::new(chrono::UTC_Z, 0, 2038, 01, 19, 03, 14, 07, 0)!; + let d0 = datetime::new(chrono::UTC, 0, 2038, 01, 19, 03, 14, 07, 0)!; let d1 = clone(d0); assert(d0.year as int == d1.year as int && d0.month as int == d1.month as int && diff --git a/datetime/format.ha b/datetime/format.ha @@ -397,7 +397,7 @@ fn hour12(dt: *datetime) int = { }; @test fn format() void = { - const dt = new(chrono::UTC_Z, 0, 1994, 01, 01, 02, 17, 05, 24)!; + const dt = new(chrono::UTC, 0, 1994, 01, 01, 02, 17, 05, 24)!; const cases = [ // special characters