-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): add fuzz tests failure persistence (#7336)
* feat(forge): add fuzz tests failure persistence * Enable inline file failure config * New config not needed to be Option * Persist failures in proj cache dir * Make persist dirs option, remove foundry_fuzz_cache_dir fn --------- Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
- Loading branch information
Showing
9 changed files
with
153 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: MIT OR Apache-2.0 | ||
pragma solidity 0.8.18; | ||
|
||
import "ds-test/test.sol"; | ||
import "../cheats/Vm.sol"; | ||
|
||
struct TestTuple { | ||
address user; | ||
uint256 amount; | ||
} | ||
|
||
contract FuzzFailurePersistTest is DSTest { | ||
Vm vm = Vm(HEVM_ADDRESS); | ||
|
||
function test_persist_fuzzed_failure( | ||
uint256 x, | ||
int256 y, | ||
address addr, | ||
bool cond, | ||
string calldata test, | ||
TestTuple calldata tuple, | ||
address[] calldata addresses | ||
) public { | ||
// dummy assume to trigger runs | ||
vm.assume(x > 1 && x < 1111111111111111111111111111); | ||
vm.assume(y > 1 && y < 1111111111111111111111111111); | ||
require(false); | ||
} | ||
} |