test: add fuzz test

build: upgrade to latest forge-std
chore: disable "func-name-mixedcase" rule
test: rename test names to conform with Foundry best practices
This commit is contained in:
Paul Razvan Berg 2023-01-07 11:47:59 +02:00
parent c0d28ea3f4
commit b67c427d3b
No known key found for this signature in database
GPG Key ID: BCC366159BD63828
3 changed files with 11 additions and 3 deletions

View File

@ -3,6 +3,7 @@
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.4"],
"func-name-mixedcase": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
"max-line-length": ["error", 120],
"not-rely-on-time": "off",

@ -1 +1 @@
Subproject commit eb980e1d4f0e8173ec27da77297ae411840c8ccb
Subproject commit b78fdb5aed571e20c8b1f52a67566ed5bac0be59

View File

@ -13,9 +13,16 @@ contract FooTest is PRBTest, StdCheats {
// solhint-disable-previous-line no-empty-blocks
}
/// @dev Run Forge with `-vvvv` to see console logs.
function testExample() external {
/// @dev Simple test. Run Forge with `-vvvv` to see console logs.
function test_Example() external {
console2.log("Hello World");
assertTrue(true);
}
/// @dev Test that fuzzes an unsigned integer. Run Forge with `-vvvv` to see console logs.
function testFuzz_Example(uint256 x) external {
vm.assume(x != 0);
console2.log("x", x);
assertTrue(x > 0);
}
}