Skip to content

Add tests for non-primitive set operator HashMap paths to fix coverage regression#8

Merged
pubkey merged 3 commits into
mainfrom
copilot/fix-code-test-coverage
Mar 20, 2026
Merged

Add tests for non-primitive set operator HashMap paths to fix coverage regression#8
pubkey merged 3 commits into
mainfrom
copilot/fix-code-test-coverage

Conversation

Copilot AI commented Mar 20, 2026

Copy link
Copy Markdown

Codecov project check fails because the ES2025 Set fast-path optimizations in $setEquals/$setIsSubset left the HashMap fallback (non-primitive elements) untested, dropping project coverage from 99.59% → 99.50%.

  • $setEquals: Added object-array tests covering the HashMap path for both equal (true via line 44) and size-mismatch (false via line 42) cases
  • $setIsSubset: Added object-array subset test triggering the early-termination branch (line 36)

All existing tests used primitive values, so the native Set.isSubsetOf() fast path was always taken. These four new cases force the HashMap codepath:

// $setEquals — HashMap path returns true
[[[{ a: 1 }, { b: 2 }], [{ b: 2 }, { a: 1 }]], true],
// $setEquals — HashMap path, size mismatch
[[[{ a: 1 }, { b: 2 }], [{ a: 1 }]], false],
// $setIsSubset — HashMap early termination
[[[{ a: 1 }], [{ a: 1 }, { a: 2 }]], true],

Coverage after: setEquals.ts 85% → 100%, setIsSubset.ts branch 90% → 100%.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI and others added 2 commits March 20, 2026 12:54
Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
…e drop

Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix code test coverage issues Add tests for non-primitive set operator HashMap paths to fix coverage regression Mar 20, 2026
Copilot AI requested a review from pubkey March 20, 2026 12:59
@pubkey
pubkey marked this pull request as ready for review March 20, 2026 13:05
@pubkey
pubkey merged commit 52e5e9d into main Mar 20, 2026
2 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.

2 participants