test: add coverage for JsTypedArray toReversed, toSorted, toLocaleString#5133
test: add coverage for JsTypedArray toReversed, toSorted, toLocaleString#5133Xavrir wants to merge 4 commits intoboa-dev:mainfrom
Conversation
These methods were already implemented in both the builtins layer and the JsTypedArray wrapper but had no test coverage. Add three tests that verify: - toReversed returns a new reversed array without mutating the original - toSorted returns a new sorted array without mutating the original - toLocaleString returns a string containing the element values Ref boa-dev#3252
Test262 conformance changes
Tested main commit: |
|
no prob! happy to contribute |
Head branch was pushed to by a user without write access
|
|
||
| #[test] | ||
| fn typed_array_iterator() { | ||
| fn typed_array_to_reversed() { |
There was a problem hiding this comment.
I think you deleted the typed_array_iterator test. Can you add that back?
There was a problem hiding this comment.
So sorry about that, adding it back asap
There was a problem hiding this comment.
Fixed in 375b13c. I restored typed_array_iterator and reran cargo test -p boa_engine typed_array_ plus cargo make run-ci locally.
Restore the typed_array_iterator unit test that was accidentally dropped while adding JsTypedArray coverage. Review comment: 2955394192
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5133 +/- ##
===========================================
+ Coverage 47.24% 59.50% +12.26%
===========================================
Files 476 580 +104
Lines 46892 63160 +16268
===========================================
+ Hits 22154 37586 +15432
- Misses 24738 25574 +836 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Context
These three
JsTypedArraywrapper methods are fully implemented but had no test coverage. This PR adds unit tests for each.Ref #3252 -- the tracking issue checkboxes for
toLocaleString,toReversed, andtoSortedcan be checked off, since the implementations already exist in both the builtins layer and the Rust wrapper.Tests added
typed_array_to_reversed-- verifiestoReversed()returns a new reversed array and leaves the original unchangedtyped_array_to_sorted-- verifiestoSorted()returns a new sorted array and leaves the original unchangedtyped_array_to_locale_string-- verifiestoLocaleString()returns a string containing the element valuesAll three tests pass locally:
cargo test --package boa_engine typed_array_to_