Skip to content

Add tests for Temporal.PlainMonthDay.prototype.toLocaleString#5155

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

Add tests for Temporal.PlainMonthDay.prototype.toLocaleString#5155
Tomeshwari-02 wants to merge 1 commit intoboa-dev:mainfrom
Tomeshwari-02:codex/plainmonthday-tolocalestring-tests

Conversation

@Tomeshwari-02
Copy link

Description

This PR adds comprehensive test coverage for the existing toLocaleString() method on Temporal.PlainMonthDay as specified in issue #5085.

What's Included

Test Coverage (6 tests)

  • ✅ Basic construction and property access
  • ✅ Basic toLocaleString() functionality
  • ✅ With calendar parameter ('iso8601')
  • ✅ With locales parameter (single string and array)
  • ✅ With options parameter
  • ✅ Different month/day combinations (New Year, Independence Day, Halloween)

Implementation Details

The toLocaleString() method already exists in the codebase but had no test coverage. This PR adds:

  1. Test file created: core/engine/src/builtins/temporal/plain_month_day/tests.rs
  2. Module declaration added: #[cfg(test)] mod tests; in mod.rs
  3. Comprehensive test suite: 6 test functions covering various scenarios

Current Implementation Note

The current implementation returns ISO string format (e.g., "12-25") until full ECMA-402 Intl.DateTimeFormat integration is completed. This approach:

  • ✅ Matches the pattern used by other Temporal built-ins (PlainDate, PlainTime, ZonedDateTime)
  • ✅ Is functional and usable
  • ✅ Has clear TODO comments for future enhancement
  • ✅ Follows Boa's incremental development approach

Testing Results

running 6 tests
test builtins::temporal::plain_month_day::tests::pmd_basic_construction ... ok
test builtins::temporal::plain_month_day::tests::pmd_to_locale_string_basic ... ok
test builtins::temporal::plain_month_day::tests::pmd_to_locale_string_with_calendar ... ok
test builtins::temporal::plain_month_day::tests::pmd_to_locale_string_with_locales ... ok
test builtins::temporal::plain_month_day::tests::pmd_to_locale_string_with_options ... ok
test builtins::temporal::plain_month_day::tests::pmd_to_locale_string_different_dates ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured

- Add comprehensive test coverage for toLocaleString method
- Test basic functionality and parameter acceptance
- Test with different month/day combinations
- Verify locales and options parameters are accepted
- Note: Implementation falls back to ISO format until ECMA-402 integration

Closes boa-dev#5085
@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: d9ea818078e18c5d51cfeeeb88e53c0b5aad4799
Compare commits: 055ee09...d9ea818

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.

2 participants