mirror of
https://github.com/vacp2p/foundry-template.git
synced 2025-02-19 18:48:15 +00:00
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:
parent
c0d28ea3f4
commit
b67c427d3b
@ -3,6 +3,7 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"code-complexity": ["error", 8],
|
"code-complexity": ["error", 8],
|
||||||
"compiler-version": ["error", ">=0.8.4"],
|
"compiler-version": ["error", ">=0.8.4"],
|
||||||
|
"func-name-mixedcase": "off",
|
||||||
"func-visibility": ["error", { "ignoreConstructors": true }],
|
"func-visibility": ["error", { "ignoreConstructors": true }],
|
||||||
"max-line-length": ["error", 120],
|
"max-line-length": ["error", 120],
|
||||||
"not-rely-on-time": "off",
|
"not-rely-on-time": "off",
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit eb980e1d4f0e8173ec27da77297ae411840c8ccb
|
Subproject commit b78fdb5aed571e20c8b1f52a67566ed5bac0be59
|
@ -13,9 +13,16 @@ contract FooTest is PRBTest, StdCheats {
|
|||||||
// solhint-disable-previous-line no-empty-blocks
|
// solhint-disable-previous-line no-empty-blocks
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @dev Run Forge with `-vvvv` to see console logs.
|
/// @dev Simple test. Run Forge with `-vvvv` to see console logs.
|
||||||
function testExample() external {
|
function test_Example() external {
|
||||||
console2.log("Hello World");
|
console2.log("Hello World");
|
||||||
assertTrue(true);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user