Skip to content

assert: fix partial matching of Set and Map entries - #67338

Open
Stella050408 wants to merge 1 commit into
nodejs:mainfrom
Stella050408:fix/partial-set-map-matching-67317
Open

Stella050408 wants to merge 1 commit into
nodejs:mainfrom
Stella050408:fix/partial-set-map-matching-67317

Conversation

@Stella050408

Copy link
Copy Markdown

Partial comparisons can greedily consume an entry needed by another Set member or Map entry, rejecting collections that are deeply equal after reordering

Retry failed greedy matches using augmenting paths and cached candidate comparisons, and try both pairings for two-element Sets

Add regression coverage for reordered entries, partial subsets, shared references, Map values and circular entries

Validation on a native macOS arm64 build:

  • All 16 assert/util test files passed
  • Targeted ESLint and diff checks passed
  • Full test suite not run locally

Fixes: #67317

Retry overlapping partial collection matches with augmenting paths
when greedy matching fails, while retaining the existing success paths

Handle the alternate pairing for two-element Sets and cover reordered
entries, shared references, Map values and cycles

Fixes: nodejs#67317
Assisted-by: Codex
Signed-off-by: Stella <353917373+Stella050408@users.noreply.github.com>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal.

Caution

AgentScan found account activity patterns that may be consistent with automation. This is a heuristic, not proof that this pull request was opened by an agent or violates policy. AI-assisted contributions are permitted, but automated tooling must not open pull requests without advance approval, and contributors must personally understand, test, verify, and take responsibility for every submitted change. See the AgentScan analysis, AI use policy, and automation policy for additional context.

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

Labels

agentscan:mixed-signals needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert: partialDeepStrictEqual rejects Sets that deepStrictEqual accepts

2 participants