foundry-template/test/Foo.t.sol

29 lines
994 B
Solidity
Raw Normal View History

2022-07-16 11:36:29 +00:00
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.4;
import { PRBTest } from "@prb/test/PRBTest.sol";
2023-01-07 09:50:02 +00:00
import { console2 } from "forge-std/console2.sol";
2022-10-31 16:34:49 +00:00
import { StdCheats } from "forge-std/StdCheats.sol";
2022-07-16 11:36:29 +00:00
/// @dev See the "Writing Tests" section in the Foundry Book if this is your first time with Forge.
/// https://book.getfoundry.sh/forge/writing-tests
contract FooTest is PRBTest, StdCheats {
/// @dev An optional function invoked before each test case is run
2022-07-16 11:36:29 +00:00
function setUp() public {
// solhint-disable-previous-line no-empty-blocks
}
/// @dev Simple test. Run Forge with `-vvvv` to see console logs.
function test_Example() external {
console2.log("Hello World");
2022-07-16 11:36:29 +00:00
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);
}
2022-07-16 11:36:29 +00:00
}