-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(forge): vm.expectRevert
without external call makes assertEq
pass
#4832
Comments
Here is another strange case (though possibly related): function test_addRandn_revert_Overflow() public {
Random r = seed(0);
vm.expectRevert(N32x32_Overflow.selector);
r.addRandn(sn.zeros(1, 100), sn.ONE);
} This function passes. It also passes when I remove the line containing |
@0xPhaze the Encountered 1 failing test in test/Counter.t.sol:CounterTest
[FAIL: assertion failed: 1 != 2] testFun() (gas: 3070) The 2nd test traces show to be decoding an identity precompile call, not sure if that's expected?
|
optimistically close this per comment above, @0xPhaze please reopen if still an issue. thank you! |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
No response
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
This test passes.
I know
vm.expectRevert
is not intended to be used on anything but external calls, but I still like using it for testing free functions.The text was updated successfully, but these errors were encountered: