mirror of
https://github.com/autistic-symposium/blockchains-security-toolkit.git
synced 2025-05-15 05:02:22 -04:00
chore: forge init
This commit is contained in:
parent
203a3d393a
commit
fc5bd836fc
6 changed files with 104 additions and 0 deletions
24
foundry_exploits/test/Counter.t.sol
Normal file
24
foundry_exploits/test/Counter.t.sol
Normal file
|
@ -0,0 +1,24 @@
|
|||
// SPDX-License-Identifier: UNLICENSED
|
||||
pragma solidity ^0.8.13;
|
||||
|
||||
import "forge-std/Test.sol";
|
||||
import "../src/Counter.sol";
|
||||
|
||||
contract CounterTest is Test {
|
||||
Counter public counter;
|
||||
|
||||
function setUp() public {
|
||||
counter = new Counter();
|
||||
counter.setNumber(0);
|
||||
}
|
||||
|
||||
function testIncrement() public {
|
||||
counter.increment();
|
||||
assertEq(counter.number(), 1);
|
||||
}
|
||||
|
||||
function testSetNumber(uint256 x) public {
|
||||
counter.setNumber(x);
|
||||
assertEq(counter.number(), x);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue