-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e85c025
commit 0bcb63b
Showing
3 changed files
with
27 additions
and
18 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
test/built-ins/Temporal/ZonedDateTime/prototype/subtract/overflow.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,26 @@ | ||
// Copyright (C) 2023 Igalia, S.L. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-temporal.zoneddatetime.prototype.subtract | ||
description: Hours overflow. | ||
includes: [temporalHelpers.js] | ||
features: [Temporal] | ||
---*/ | ||
|
||
// subtract result | ||
// var later = Temporal.ZonedDateTime.from("2019-10-29T10:46:38.271986102-03:00[-03:00]"); | ||
var later = new Temporal.ZonedDateTime(1572356798271986102n, "-03:00"); | ||
var earlier = later.subtract({ hours: 12 }); | ||
|
||
TemporalHelpers.assertZonedDateTimesEqual( | ||
earlier, | ||
// "2019-10-28T22:46:38.271986102-03:00[-03:00]" | ||
new Temporal.ZonedDateTime(1572313598271986102n, "-03:00")); | ||
|
||
// "2020-05-31T23:12:38.271986102-04:00[-04:00]" | ||
earlier = new Temporal.ZonedDateTime(1590981158271986102n, "-04:00"); | ||
later = new Temporal.ZonedDateTime(1590988358271986102n, "-04:00"); | ||
|
||
TemporalHelpers.assertZonedDateTimesEqual(earlier.subtract({ hours: -2 }), later); | ||
|