test: add core WeakSet builtin unit tests#4912
test: add core WeakSet builtin unit tests#4912mrhapile wants to merge 3 commits intoboa-dev:mainfrom
Conversation
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds initial Rust-level unit tests for the WeakSet builtin in Boa’s core engine, complementing existing test262 coverage and aligning with the structure used for other builtin tests.
Changes:
- Introduces
core/engine/src/builtins/weak_set/tests.rswith basic behavioral tests foradd,has,delete, andadd()chaining. - Wires the new test module into the
WeakSetbuiltin via#[cfg(test)] mod tests;.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/engine/src/builtins/weak_set/tests.rs | Adds initial unit tests covering core WeakSet prototype behaviors. |
| core/engine/src/builtins/weak_set/mod.rs | Registers the new tests submodule under cfg(test). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Test262 conformance changes
Tested main commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4912 +/- ##
===========================================
+ Coverage 47.24% 57.73% +10.49%
===========================================
Files 476 556 +80
Lines 46892 60739 +13847
===========================================
+ Hits 22154 35068 +12914
- Misses 24738 25671 +933 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
### This PR expands the WeakSet unit test coverage. _The initial WeakSet tests introduced basic behavioral tests._ **#4912** This PR adds additional ECMAScript edge case coverage. The following behaviors are now tested: - Primitive rejection in WeakSet.prototype.add - Primitive-safe behavior for WeakSet.prototype.has - Primitive-safe behavior for WeakSet.prototype.delete - Duplicate object additions These tests ensure correct handling of **ECMAScript §24.4 WeakSet** invariants and improve robustness during future refactors. <img width="816" height="226" alt="Screenshot 2026-03-07 at 7 15 01 AM" src="https://github.com/user-attachments/assets/713b64e9-3d21-4fd2-9bb9-4384df7755af" /> All tests follow the same pattern used by other builtin tests. --------- Signed-off-by: mrhapile <allinonegaming3456@gmail.com>
|
Superseeded by #4914 |
This PR introduces initial unit tests for the WeakSet builtin.
Currently the WeakSet implementation relies entirely on test262 coverage
and does not have internal Rust-level tests in the Boa engine.
This PR adds:
core/engine/src/builtins/weak_set/tests.rs
The following behaviors are tested:
These tests follow the same structure used by other builtin tests
such as WeakMap, Map, and Set.
Additional edge case tests will be added in a follow-up PR.