forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSkip.t.sol
38 lines (31 loc) · 1.01 KB
/
Skip.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.18;
import "ds-test/test.sol";
import "cheats/Vm.sol";
contract SkipTest is DSTest {
Vm constant vm = Vm(HEVM_ADDRESS);
function testSkip() public {
vm.skip(true);
revert("Should not reach this revert");
}
/// forge-config: default.allow_internal_expect_revert = true
function testRevertIfNotSkip() public {
vm.skip(false);
vm.expectRevert("This test should fail");
revert("This test should fail");
}
function testFuzzSkip(uint256 x) public {
vm.skip(true);
revert("Should not reach revert");
}
/// forge-config: default.allow_internal_expect_revert = true
function testRevertIfFuzzSkip(uint256 x) public {
vm.skip(false);
vm.expectRevert("This test should fail");
revert("This test should fail");
}
function statefulFuzzSkip() public {
vm.skip(true);
require(true == false, "Test should not reach invariant");
}
}