Skip to content

Add jsnums-test spec for canonical BigInteger representation (re-do)#1868

Open
jpolitz wants to merge 2 commits into
horizonfrom
jsnums-test-bigint-canonical-v2
Open

Add jsnums-test spec for canonical BigInteger representation (re-do)#1868
jpolitz wants to merge 2 commits into
horizonfrom
jsnums-test-bigint-canonical-v2

Conversation

@jpolitz
Copy link
Copy Markdown
Member

@jpolitz jpolitz commented May 5, 2026

Supersedes #1867, which I closed after Copilot mis-resolved the conflict by merging master into the branch (the PR is based on horizon). Same single commit, this time merged from horizon so the only diff is the new it(...) block.

Joe says:

Trying to work my way through different image library tests in orthogonal easy-to-review commits. @blerner let me know if this is helpful as a workflow.

Claude says:

Adds an it("BigInteger uses a canonical representation (toEqual works)") block that pins down the invariant established by the bnpClamp delete-loop in eb0d524: two BigIntegers representing the same number, built via different paths, must be structurally equal (jasmine toEqual), not just numerically equal (JN.equals).

Verified the spec catches the regression: temporarily short-circuiting the bnpClamp delete-loop fails with "Expected object not to have properties: 18: 33554432" — the phantom-slot symptom the fix addresses.

jpolitz and others added 2 commits May 4, 2026 12:16
Joe says:

Trying to work my way through different image library tests in orthogonal
easy-to-review commits

Claude says:

Adds an `it("BigInteger uses a canonical representation (toEqual works)")`
block that pins down the invariant established by the bnpClamp delete-loop
in eb0d524: two BigIntegers representing the same number, built via
different paths, must be structurally equal (jasmine `toEqual`), not just
numerically equal (`JN.equals`).

Verified the spec catches the regression: temporarily short-circuiting the
bnpClamp delete-loop fails with "Expected object not to have properties:
18: 33554432" — the phantom-slot symptom the fix addresses.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…-canonical

# Conflicts:
#	tests/jsnums-test/jsnums-test.js
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.

1 participant