Cannot check negative expectCall assertion with any other expectCall assertion. #5655
Closed
2 tasks done
Labels
T-bug
Type: bug
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (11b08e9 2023-08-16T00:24:01.780465000Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
count
was added toexpectCall
here: #4833It allows for the ability to check that a function isn't called, by checking
count == 0
. Because of the way negative assertions have been implemented, it is not possible to combine them with other assertions around whether a function has been called or not, as you will receive this error:[FAIL. Reason: Counted expected calls can only bet set once.]
< also notice the typoWhereas it would be possible to check in a test that different functions are being called by doing something like this:
Where,
where
anddata
can be the same in both cases, andX()
andY()
can be the same in both cases. It fails even if you do the following:vm.expectCall(where, data)
vm.expectCall(where, data, count=0)
with the same error as above.
The text was updated successfully, but these errors were encountered: