-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e44bfb6
commit 5296b31
Showing
4 changed files
with
27 additions
and
29 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
File renamed without changes.
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 |
---|---|---|
@@ -1,24 +1,28 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
pragma solidity ^0.8.23; | ||
|
||
import {Test, console} from "forge-std/Test.sol"; | ||
// import {Counter} from "../src/Counter.sol"; | ||
import {Test} from "lib/forge-std/src/Test.sol"; | ||
import {XottleToken} from "../src/XottleToken.sol"; | ||
|
||
// contract CounterTest is Test { | ||
// Counter public counter; | ||
contract XottleTokenTest is Test { | ||
XottleToken public token; | ||
address public owner; | ||
|
||
// function setUp() public { | ||
// counter = new Counter(); | ||
// counter.setNumber(0); | ||
// } | ||
function setUp() public { | ||
owner = address(this); | ||
token = new XottleToken(owner); | ||
} | ||
|
||
// function test_Increment() public { | ||
// counter.increment(); | ||
// assertEq(counter.number(), 1); | ||
// } | ||
function testMint() public { | ||
uint256 amount = 1000; | ||
token.mint(address(this), amount); | ||
assertEq(token.balanceOf(address(this)), amount); | ||
} | ||
|
||
// function testFuzz_SetNumber(uint256 x) public { | ||
// counter.setNumber(x); | ||
// assertEq(counter.number(), x); | ||
// } | ||
// } | ||
function testApprove() public { | ||
uint256 amount = 500; | ||
token.mint(address(this), 1000); // Mint tokens first | ||
token.approve(address(0xBEEF), amount); | ||
assertEq(token.allowance(address(this), address(0xBEEF)), amount); | ||
} | ||
} |