-
Notifications
You must be signed in to change notification settings - Fork 461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Temporal: Tests for Duration rounding fix & consolidation #4041
Merged
Conversation
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
91 tasks
ptomato
force-pushed
the
temporal-2742
branch
3 times, most recently
from
May 2, 2024 17:57
12a9cd8
to
ad07213
Compare
This is ready now. |
ptomato
changed the title
Draft: Temporal: Tests for Duration rounding fix & consolidation
Temporal: Tests for Duration rounding fix & consolidation
May 8, 2024
The few test files that are actually relevant to review, not just trivial adjustments, are:
And note the change to weeks rounding in the various |
arshaw
reviewed
May 9, 2024
test/built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-non-integer.js
Show resolved
Hide resolved
A MoveRelativeZonedDateTime step was missing, causing incorrect results. See tc39/proposal-temporal#2742
This should produce all the same results (except for a change to weeks balancing in round(), which is now more consistent with since()/until()) but leads to different observable user code calls. See tc39/proposal-temporal#2742
Including tests for every possible combination of largest and smallest unit, for each type of relativeTo (undefined, PlainDate, ZonedDateTime).
In ZonedDateTime.p.since/until, it's possible for AddDateTime to hit the limit if the rounding increment is very high, even if the resulting rounded duration isn't outside of the limit. Add a test covering this case.
…ding This covers an edge case that we hit, where 24 hours would not balance up to one day in a 25-hour day if only largestUnit was specified, but would erroneously balance up if rounding was also performed by specifying smallestUnit.
Ms2ger
approved these changes
May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains test coverage for tc39/proposal-temporal#2758 which was a normative change that reached consensus at the February 2024 TC39 meeting.
Note that we still expect some review comments from implementors on that PR, so these tests are currently marked as a draft.