Skip to content

fix: compare both outer lengths in array2DEquals - #573

Merged
hsluoyz merged 1 commit into
apache:masterfrom
dajiaohuang:fix/array2d-length-w17
Oct 25, 2026
Merged

hsluoyz merged 1 commit into
apache:masterfrom
dajiaohuang:fix/array2d-length-w17

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Util.array2DEquals reads a.length for both operands. As a result, an empty left array compares equal to a nonempty right array, and a matching prefix can hide trailing rows. Read b.length for the second operand.

Add a regression covering both operand orders, trailing rows and empty rows, with a positive equality control. The new test fails on the original code (expected false, received true).

Validation: lint passes with the yarn.lock Prettier 2.2.1 version; all 18 Jest suites / 240 tests pass with CASBIN_CONFORMANCE_DIR set to task-local upstream fixtures; coverage and both CJS/ESM builds pass.

AI assistance: OpenAI Codex CLI 0.163.0.

Assisted-by: OpenAI Codex CLI 0.163.0
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@fed65ac). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #573   +/-   ##
=========================================
  Coverage          ?   71.31%           
=========================================
  Files             ?       34           
  Lines             ?     2207           
  Branches          ?      518           
=========================================
  Hits              ?     1574           
  Misses            ?      381           
  Partials          ?      252           
Flag Coverage Δ
node-^20 71.31% <100.00%> (?)
node-^22 71.31% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hsluoyz
hsluoyz merged commit 7dbadda into apache:master Oct 25, 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.

3 participants