From 6371be8338eb8eae2b853cd2543728bc91da68b6 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 5 Sep 2023 16:36:49 -0700 Subject: [PATCH] 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. --- .../temporalHelpers-sample-time-zones.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/harness/temporalHelpers-sample-time-zones.js b/test/harness/temporalHelpers-sample-time-zones.js index 097ae2d765..9fdde9a107 100644 --- a/test/harness/temporalHelpers-sample-time-zones.js +++ b/test/harness/temporalHelpers-sample-time-zones.js @@ -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', +);