Skip to content

Add tests for Temporal.PlainTime.prototype.toLocaleString#5157

Closed
Tomeshwari-02 wants to merge 1 commit intoboa-dev:mainfrom
Tomeshwari-02:codex/plaintime-tolocalestring-tests
Closed

Add tests for Temporal.PlainTime.prototype.toLocaleString#5157
Tomeshwari-02 wants to merge 1 commit intoboa-dev:mainfrom
Tomeshwari-02:codex/plaintime-tolocalestring-tests

Conversation

@Tomeshwari-02
Copy link

✨ Add test coverage for Temporal.PlainTime.prototype.toLocaleString

📌 Summary

This PR adds comprehensive test coverage for the Temporal.PlainTime.prototype.toLocaleString method to ensure correct behavior across common use cases and edge cases.


✅ Changes

  • Added 7 test cases for toLocaleString

  • Covered:

    • Basic functionality

    • Edge cases:

      • Midnight (00:00:00)
      • Noon (12:00:00)
    • Multiple time combinations

    • Acceptance of locales parameter

    • Acceptance of options parameter


🧪 Test Details

New tests added in:

core/engine/src/builtins/temporal/plain_time/tests.rs

Key test cases:

  • pt_to_locale_string_basic
  • pt_to_locale_string_with_midnight
  • pt_to_locale_string_with_noon
  • pt_to_locale_string_with_locales
  • pt_to_locale_string_with_options
  • pt_to_locale_string_different_times

⚠️ Note

  • Current implementation falls back to ISO formatting
  • Full localization support will depend on future ECMA-402 integration

🔗 Related Issue

Closes #5084


🚀 Impact

  • Improves reliability and confidence in toLocaleString
  • Ensures future implementations remain backward compatible
  • Provides a strong foundation for upcoming localization support

- Add comprehensive test coverage for toLocaleString method
- Test basic functionality and parameter acceptance
- Test with different time combinations (midnight, noon, various times)
- Verify locales and options parameters are accepted
- Note: Implementation falls back to ISO format until ECMA-402 integration

Closes #5084
@github-actions github-actions bot added Waiting On Review Waiting on reviews from the maintainers C-Tests Issues and PRs related to the tests. C-Builtins PRs and Issues related to builtins/intrinsics and removed Waiting On Review Waiting on reviews from the maintainers labels Mar 19, 2026
@github-actions github-actions bot added this to the v1.0.0 milestone Mar 19, 2026
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 52,963 52,963 0
Passed 50,073 50,073 0
Ignored 2,072 2,072 0
Failed 818 818 0
Panics 0 0 0
Conformance 94.54% 94.54% 0.00%

Tested main commit: 055ee0958ce332f3f99af27536a7c6f9a91def27
Tested PR commit: 9684eab00249bfe23590ea0eb505cdcae6f18efb
Compare commits: 055ee09...9684eab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Builtins PRs and Issues related to builtins/intrinsics C-Tests Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Temporal.PlainTime.prototype.toLocaleString

3 participants