test: prove the call recorder records non-initialize calls - #264
Open
thedavidmeister wants to merge 2 commits into
Open
thedavidmeister wants to merge 2 commits into
thedavidmeister wants to merge 2 commits into
Conversation
`testCloneDeterministicInitializeIsTheOnlyCall` pins the spec's "MUST NOT call any other functions on the cloned proxy" with `selectors.length == 1`, and the only thing that can make that assertion fail is `TestCloneableCallRecorder.fallback` appending `msg.sig`. No test ever dispatched a non-`initialize` selector at a recorder clone, so the fallback's push never ran anywhere and nothing separated "the factory made exactly one call" from "the recorder stopped recording". Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…call-recorder-records
|
Warning Review limit reachedNext included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (1)
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. Comment |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #122
testCloneDeterministicInitializeIsTheOnlyCallpins "MUST NOT call any otherfunctions on the cloned proxy before
initializecompletes successfully" withassertEq(selectors.length, 1). That is a negative assertion, and the onlything in the repo that can make it fail is
TestCloneableCallRecorder.fallback()appending
msg.sig. No test ever dispatched a non-initializeselector at arecorder clone, so that push never executed: the assertion could not tell "the
factory made exactly one call" from "the recorder stopped recording".
testCallRecorderRecordsNonInitializeCallsfuzzes a selector off the fixture'sown declared functions, plus trailing argument bytes, at a factory-deployed
clone, and asserts the sequence becomes
[initialize, selector]with theinitialized
sDatauntouched.QA
testCallRecorderRecordsNonInitializeCalls(
test/src/lib/LibICloneableFactoryV4.cloneDeterministic.t.sol).TestCloneableCallRecorder.fallback()replacedwith an empty body, i.e. the detector stops detecting. On main it SURVIVES:
the
cloneDeterministicfile stays 20 passed / 0 failed, with…InitializeIsTheOnlyCallamong the passes — the exact silent vacuity theissue names. On this branch the file goes 20 passed / 1 failed, killed by this
test and nothing else. Unmutated, the whole suite is 79 passed / 0 failed.
…InitializeIsTheOnlyCallis an assertionabout the factory only if the recorder records; otherwise it is an assertion
about nothing, and no
src/mutant can say which, because the defect lives intest-side code the campaign does not mutate.
suite triggers". Every fixture in
test/concrete/was enumerated against itsusers:
TestCloneable's once-only guard and typed-overload revert aretriggered by
test/src/interface/ICloneableV2.initialize.t.sol,TestCloneableFailure's non-success return by…InitializeFailureFailsonboth paths,
TestCloneableRevert's revert by…InitializeRevertBubbles,TestCloneableRawAnswer's raw return bycloneAndInitialize.t.sol,TestCloneFactory's delegation by every flow test, and the recorder'sInitializingevent by…EventPrecedesInitialize. The recorder'sfallbackwas the only one nothing reached.
Touches
test/src/lib/LibICloneableFactoryV4.cloneDeterministic.t.sol, as doesthe PR for #166 — both branch off
main, about 25 lines apart in that file.🤖 Generated with Claude Code