-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Unexpected Behaviour with vm.expectRevert() #6331
Comments
What Foundry version are you on? |
v0.2.0 @DaniPopes |
@Equious Can you share your |
Here you are! @gakonst |
Ah I see what's happening here, @Equious your test name starts with "testFail" which expects the test to fail. Either rename the test to |
To summarize -
vm.expectRevert(bytes("Custom Error Message"))
will pass a test regardless of if the custom error message actually matches.Contract function for reference:
Test being run:
Result in Terminal:
The test seems to recognize the error is not what's expected, but passes anyway.
A further, perhaps related behaviour I can't explain is that removing the arguments passed to
vm.expectRevert()
- which should result in a pass for any revert - actually fails, despite catching the revert.Function
Result in Terminal:
The text was updated successfully, but these errors were encountered: