Skip to content

Commit

Permalink
feat: count assertion for expectRevert (#638)
Browse files Browse the repository at this point in the history
Ref: foundry-rs/foundry#9484

```solidity

    /// Expects `count` number of reverts from the upcoming calls with any revert data or reverter.
    function expectRevert(uint64 count) external;

    /// Expects `count` number of reverts from the upcoming calls that match the revert data.
    function expectRevert(bytes4 revertData, uint64 count) external;

    /// Expects `count` number of reverts from the upcoming calls that exactly match the revert data.
    function expectRevert(bytes calldata revertData, uint64 count) external;

    /// Expects `count` number of reverts from the upcoming calls from the reverter address.
    function expectRevert(address reverter, uint64 count) external;

    /// Expects `count` number of reverts from the upcoming calls from the reverter address that match the revert data.
    function expectRevert(bytes4 revertData, address reverter, uint64 count) external;

    /// Expects `count` number of reverts from the upcoming calls from the reverter address that exactly match the revert data.
    function expectRevert(bytes calldata revertData, address reverter, uint64 count) external;
```
  • Loading branch information
yash-atreya authored Dec 6, 2024
1 parent 051fb65 commit d3db4ef
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/Vm.sol

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/Vm.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Vm, VmSafe} from "../src/Vm.sol";
// added to or removed from Vm or VmSafe.
contract VmTest is Test {
function test_VmInterfaceId() public pure {
assertEq(type(Vm).interfaceId, bytes4(0x21af9696), "Vm");
assertEq(type(Vm).interfaceId, bytes4(0xbe425eb2), "Vm");
}

function test_VmSafeInterfaceId() public pure {
Expand Down

0 comments on commit d3db4ef

Please sign in to comment.