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 date difference algorithm #4004

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

ptomato
Copy link
Contributor

@ptomato ptomato commented Feb 7, 2024

This adds tests specifically for every kind of case that changes due to the tweak to the date difference algorithm: differences from a longer month to a shorter month, when the months are adjacent, in the same year but not adjacent, and in different years.

Also adds tests for a case that does not change, but would trip on an incorrectly implemented algorithm: when the intermediate months value falls at the end of February.

There was incidental coverage of the change to the date difference algorithm in other tests. Those are adjusted, as well.

Normative change: tc39/proposal-temporal#2759
Consensus in February 2024

This adds tests specifically for every kind of case that changes due to
the tweak to the date difference algorithm: differences from a longer
month to a shorter month, when the months are adjacent, in the same year
but not adjacent, and in different years.

Also adds tests for a case that does *not* change, but would trip on an
incorrectly implemented algorithm: when the intermediate months value
falls at the end of February.

There was incidental coverage of the change to the date difference
algorithm in other tests. Those are adjusted, as well.

Normative change: tc39/proposal-temporal#2759
Consensus in February 2024
@ptomato ptomato force-pushed the temporal-2535-end-of-month-edge-cases branch from 6815174 to 406d51b Compare February 9, 2024 23:58
@ptomato
Copy link
Contributor Author

ptomato commented Feb 10, 2024

Thanks for the review.

@ptomato ptomato merged commit 49e56ac into tc39:main Feb 10, 2024
9 checks passed
@ptomato ptomato deleted the temporal-2535-end-of-month-edge-cases branch February 10, 2024 00: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