Temporal Helpers: Add harness tests for DST sample time zone

Just to make sure the time zone arithmetic matches the actual time zone
that it is based on.
This commit is contained in:
Philip Chimento 2023-09-05 16:36:49 -07:00 committed by Philip Chimento
parent d03ed25a21
commit 6371be8338
1 changed files with 18 additions and 0 deletions

View File

@ -89,3 +89,21 @@ checkTimeZoneArithmetic(
TemporalHelpers.crossDateLineTimeZone(),
'Pacific/Apia',
);
// Check the spring-forward transition of the DST sample time zone
checkTimeZoneArithmetic(
new Temporal.Instant(954669600_000_000_000n),
new Temporal.PlainDateTime(2000, 4, 2, 2),
{ minutes: 30 },
TemporalHelpers.springForwardFallBackTimeZone(),
'America/Vancouver',
);
// Check the fall-back transition of the DST sample time zone
checkTimeZoneArithmetic(
new Temporal.Instant(972810000_000_000_000n),
new Temporal.PlainDateTime(2000, 10, 29, 2),
{ minutes: 30 },
TemporalHelpers.springForwardFallBackTimeZone(),
'America/Vancouver',
);