Skip to content

Conversation

@catamorphism
Copy link
Contributor

Add coverage for a variety of rounding increments for Instant, PlainTime, and ZonedDateTime (PlainDateTime already has these tests). This provides coverage for a bug observed in GraalJS that rejected certain valid rounding increments.

Add coverage for a variety of rounding increments for Instant,
PlainTime, and ZonedDateTime (PlainDateTime already has these tests).
This provides coverage for a bug observed in GraalJS that rejected
certain valid rounding increments.
@catamorphism catamorphism requested a review from a team as a code owner December 18, 2025 22:04

[1, 2, 3, 4, 6, 8, 12].forEach((roundingIncrement) => {
assert.sameValue(
t.round({ smallestUnit: "hour", roundingIncrement }) instanceof Temporal.PlainDateTime,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure these shouldn't be PDTs. And probably this test would benefit from using the unitsAndIncrements table as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, fixed in 99c46d3; also changed it to use a table.

}), Temporal.Instant.from("1976-11-18T14:23:30.12345679Z"));

const unitsAndIncrements =
{"hour": [1, 2, 4, 6, 8, 12, 24],
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: please format these consistently between files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 99c46d3

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