Skip to content
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 balancing units after rounding #3956

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Nov 6, 2023

This PR contains tests that cover normative changes to Temporal that reached consensus in May 2023.
Normative PR: tc39/proposal-temporal#2571

Copy link
Contributor

@cjtenny cjtenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look good to me; they cover the changes in tc39/proposal-temporal#2571 and the bug that I found in the spec change didn't affect the tests - tests were correct for desired behavior, spec text had just one oops that's been fixed!

See tc39/proposal-temporal#2563

The old behaviour was encoded in one test in staging, but the behaviour of
largestUnit in duration rounding has changed since that test was written.
Therefore I'm assuming that toString() should've been updated when that
happened.
In order to fix tc39/proposal-temporal#2563, we added invocations of
BalanceDurationRelative after some invocations of RoundDuration. These
cause observable calendar calls, which must be accounted for in some
existing tests.
@ptomato ptomato force-pushed the temporal-2563-balance-after-round branch from 4fdda57 to 0523ef7 Compare November 14, 2023 17:42
@ptomato
Copy link
Contributor Author

ptomato commented Nov 14, 2023

Thanks for the review!

@ptomato ptomato merged commit 7c41695 into tc39:main Nov 14, 2023
9 checks passed
@ptomato ptomato deleted the temporal-2563-balance-after-round branch November 14, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants