My working unpac space for OCaml projects in development
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Temporal] Add coverage for ZonedDateTime offsets before 1883

Add test that adding/subtracting a large duration to a ZonedDateTime
in the America/Vancouver time zone results in a ZonedDateTime
with the correct offset (prior to the introduction of standard time zones).

This provides coverage for a bug observed in GraalJS.

authored by

Tim Chevalier and committed by
Ms2ger
c7e0ff69 3fc3fb74

+30
+15
vendor/git/test262/test/intl402/Temporal/ZonedDateTime/prototype/add/offset-before-1883.js
··· 1 + // Copyright (C) 2023 Justin Grant. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.zoneddatetime.prototype.add 6 + description: Addition resulting in a pre-1883 date returns the correct offset 7 + features: [Temporal] 8 + ---*/ 9 + 10 + const instance = Temporal.ZonedDateTime.from("2001-09-08T18:46:40-07:00[America/Vancouver]"); 11 + const expectedOffset = "-08:12:28"; // Offset before introduction of standard time zones 12 + 13 + assert.sameValue(instance.add(Temporal.Duration.from("-P5432Y1837M")).offset, expectedOffset, `add -P5432Y1837M, offset should be ${expectedOffset}`); 14 + assert.sameValue(instance.add(Temporal.Duration.from("-P5432Y1836M")).offset, expectedOffset, `add -P5432Y1836M, offset should be ${expectedOffset}`); 15 + assert.sameValue(instance.add(Temporal.Duration.from("-P5432Y1835M")).offset, expectedOffset, `add -P5432Y1835M, offset should be ${expectedOffset}`);
+15
vendor/git/test262/test/intl402/Temporal/ZonedDateTime/prototype/subtract/offset-before-1883.js
··· 1 + // Copyright (C) 2023 Justin Grant. All rights reserved. 2 + // This code is governed by the BSD license found in the LICENSE file. 3 + 4 + /*--- 5 + esid: sec-temporal.zoneddatetime.prototype.subtract 6 + description: Subtraction resulting in a pre-1883 date returns the correct offset 7 + features: [Temporal] 8 + ---*/ 9 + 10 + const instance = Temporal.ZonedDateTime.from("2001-09-08T18:46:40-07:00[America/Vancouver]"); 11 + const expectedOffset = "-08:12:28"; // Offset before introduction of standard time zones 12 + 13 + assert.sameValue(instance.subtract(Temporal.Duration.from("P5432Y1837M")).offset, expectedOffset, `subtract -P5432Y1837M, offset should be ${expectedOffset}`); 14 + assert.sameValue(instance.subtract(Temporal.Duration.from("P5432Y1836M")).offset, expectedOffset, `subtract -P5432Y1836M, offset should be ${expectedOffset}`); 15 + assert.sameValue(instance.subtract(Temporal.Duration.from("P5432Y1835M")).offset, expectedOffset, `subtract -P5432Y1835M, offset should be ${expectedOffset}`);