Skip to content

test(pointers): assert buildLiteralParserFunctionPointers returns empty bytes#213

Open
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-22-issue-35-137-pointer-integrity-tests
Open

test(pointers): assert buildLiteralParserFunctionPointers returns empty bytes#213
thedavidmeister wants to merge 1 commit into
mainfrom
2026-06-22-issue-35-137-pointer-integrity-tests

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

ERC4626SubParser has no literal parser words, so buildLiteralParserFunctionPointers() always returns "". The existing pointer consistency suite (ERC4626Words.pointers.t.sol) tested all other build functions against their committed constants but was missing a test for the literal parser. This adds testLiteralParserFunctionPointersEmpty() to complete the suite.

A mutant returning non-empty bytes from buildLiteralParserFunctionPointers() now fails forge test without relying on an out-of-band diff.

All 10 tests pass locally (forge test --match-contract ERC4626WordsPointersTest).

Closes #35
Closes #137

Co-Authored-By: Claude noreply@anthropic.com

Summary by CodeRabbit

  • Tests
    • Added new test case to validate proper handling of empty byte returns for specific operations.

…ty bytes

ERC4626SubParser has no literal parser words, so buildLiteralParserFunctionPointers()
returns "". Add testLiteralParserFunctionPointersEmpty() to the existing pointer
consistency suite so a mutant returning non-empty bytes fails forge test without
relying on an out-of-band diff.

Closes #35
Closes #137

Co-Authored-By: Claude <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 64d5f7d2-374e-46ec-86e7-3d46b84f86c9

📥 Commits

Reviewing files that changed from the base of the PR and between 7415942 and 8e038e5.

📒 Files selected for processing (1)
  • test/src/concrete/ERC4626Words.pointers.t.sol

Walkthrough

A single test function, testLiteralParserFunctionPointersEmpty, is added to the existing ERC4626WordsPointersTest contract. It calls words.buildLiteralParserFunctionPointers() and asserts the return value equals bytes("").

Changes

Literal Parser Pointer Empty Test

Layer / File(s) Summary
testLiteralParserFunctionPointersEmpty assertion
test/src/concrete/ERC4626Words.pointers.t.sol
Adds an external view test that asserts words.buildLiteralParserFunctionPointers() returns bytes(""), confirming the literal parser function pointer table is empty.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the test being added and directly matches the changeset content.
Linked Issues check ✅ Passed The PR implements testLiteralParserFunctionPointersEmpty() to verify buildLiteralParserFunctionPointers() returns empty bytes as proposed in issue #35 and #137.
Out of Scope Changes check ✅ Passed The only change is a single new test method for pointer consistency, directly aligned with the linked issues and PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-22-issue-35-137-pointer-integrity-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

None yet

Projects

None yet

1 participant