-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Temporal: Port staging tests that use next/previousTransition
- Loading branch information
Showing
10 changed files
with
68 additions
and
94 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
.../Temporal/ZonedDateTime/prototype/getTimeZoneTransition/offset-timezone-no-transitions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.zoneddatetime.prototype.gettimezonetransition | ||
description: An offset time zone has no transitions. | ||
features: [Temporal] | ||
---*/ | ||
|
||
const zdt = new Temporal.ZonedDateTime(0n, "-10:00"); | ||
assert.sameValue(zdt.getTimeZoneTransition("next"), null, "An offset time zone has no next transition"); | ||
assert.sameValue(zdt.getTimeZoneTransition("previous"), null, "An offset time zone has no previous transition"); |
12 changes: 12 additions & 0 deletions
12
test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/utc-no-transitions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.zoneddatetime.prototype.gettimezonetransition | ||
description: The UTC time zone has no transitions. | ||
features: [Temporal] | ||
---*/ | ||
|
||
const zdt = new Temporal.ZonedDateTime(0n, "UTC"); | ||
assert.sameValue(zdt.getTimeZoneTransition("next"), null, "The UTC time zone has no next transition"); | ||
assert.sameValue(zdt.getTimeZoneTransition("previous"), null, "The UTC time zone has no previous transition"); |
24 changes: 24 additions & 0 deletions
24
test/intl402/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/result-type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.zoneddatetime.prototype.gettimezonetransition | ||
description: Next and previous transition in a named time zone has the correct return type | ||
features: [Temporal] | ||
---*/ | ||
|
||
let zdt = new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); | ||
for (let count = 0; count < 4; count++) { | ||
const transition = zdt.getTimeZoneTransition("next"); | ||
assert(transition instanceof Temporal.ZonedDateTime, "getTimeZoneTransition(next) returns Temporal.ZonedDateTime"); | ||
assert(!transition.equals(zdt), "getTimeZoneTransition(next) does not return its input"); | ||
zdt = transition; | ||
} | ||
|
||
zdt = new Temporal.ZonedDateTime(1_000_000_000_000_000_000n, "America/Los_Angeles"); | ||
for (let count = 0; count < 4; count++) { | ||
const transition = zdt.getTimeZoneTransition("previous"); | ||
assert(transition instanceof Temporal.ZonedDateTime, "getTimeZoneTransition(previous) returns Temporal.ZonedDateTime"); | ||
assert(!transition.equals(zdt), "getTimeZoneTransition(previous) does not return its input"); | ||
zdt = transition; | ||
} |
20 changes: 20 additions & 0 deletions
20
test/intl402/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/specific-tzdb-values.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (C) 2024 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.zoneddatetime.prototype.gettimezonetransition | ||
description: Smoke test specific values from time zone database | ||
features: [Temporal] | ||
---*/ | ||
|
||
const a1 = new Temporal.ZonedDateTime(1555448460_000_000_000n /* = 2019-04-16T21:01Z */, "America/New_York"); | ||
assert.sameValue(a1.getTimeZoneTransition("next").epochNanoseconds, 1572760800_000_000_000n /* = 2019-11-03T06:00:00Z */); | ||
|
||
const a2 = new Temporal.ZonedDateTime(-5364662400_000_000_000n /* = 1800-01-01T00:00Z */, "America/New_York"); | ||
assert.sameValue(a2.getTimeZoneTransition("next").epochNanoseconds, -2717650800_000_000_000n /* = 1883-11-18T17:00:00Z */); | ||
|
||
const a3 = new Temporal.ZonedDateTime(1591909260_000_000_000n /* = 2020-06-11T21:01Z */, "Europe/London"); | ||
assert.sameValue(a3.getTimeZoneTransition("previous").epochNanoseconds, 1585443600_000_000_000n /* = 2020-03-29T01:00:00Z */); | ||
|
||
const a4 = new Temporal.ZonedDateTime(-3849984000_000_000_000n /* = 1848-01-01T00:00Z */, "Europe/London"); | ||
assert.sameValue(a4.getTimeZoneTransition("previous").epochNanoseconds, -3852662325_000_000_000n, /* = 1847-12-01T00:01:15Z */); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
test/staging/Temporal/TimeZone/old/getPreviousTransition.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters