Skip to content

[Temporal] Add test coverage for offset string of the form +00:0000#4763

Merged
ptomato merged 4 commits intotc39:mainfrom
catamorphism:sub-minute-precision
Dec 11, 2025
Merged

[Temporal] Add test coverage for offset string of the form +00:0000#4763
ptomato merged 4 commits intotc39:mainfrom
catamorphism:sub-minute-precision

Conversation

@catamorphism
Copy link
Copy Markdown
Contributor

@catamorphism catamorphism commented Dec 4, 2025

This string shouldn't parse (+00:00:00 or +000000 would be valid).

Add tests for date/time strings containing this offset for Instant, PlainDateTime, PlainTime, and ZonedDateTime. Also add a test for ZonedDateTime taking this offset in a property bag.

Comment thread test/built-ins/Temporal/ZonedDateTime/from/offset-string-invalid.js Outdated
Copy link
Copy Markdown
Contributor

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

Looks good, but to cover all points where these strings might be parsed, I think we need tests for the relativeTo parameter in Temporal.Duration.compare, Temporal.Duration.prototype.round, and Temporal.Duration.prototype.total. Both for ZonedDateTime strings and ZonedDateTime property bags with an offset property.

@catamorphism
Copy link
Copy Markdown
Contributor Author

Looks good, but to cover all points where these strings might be parsed, I think we need tests for the relativeTo parameter in Temporal.Duration.compare, Temporal.Duration.prototype.round, and Temporal.Duration.prototype.total. Both for ZonedDateTime strings and ZonedDateTime property bags with an offset property.

@ptomato Done in f1f5027, let me know if I missed anything.

catamorphism and others added 4 commits December 11, 2025 12:27
This string shouldn't parse (+00:00:00 or +000000 would be valid).

Add tests for date/time strings containing this offset for
Instant, PlainDateTime, PlainTime, and ZonedDateTime. Also add a
test for ZonedDateTime taking this offset in a property bag.
@ptomato ptomato force-pushed the sub-minute-precision branch from fe8537b to 390ac2d Compare December 11, 2025 20:27
@ptomato ptomato merged commit 78dbcdc into tc39:main Dec 11, 2025
14 checks passed
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.

4 participants