mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-08-16 05:22:53 +02:00
「🏗️」 wip: seemingly working smart contract
This commit is contained in:
@ -1,13 +1,33 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8;
|
||||
pragma solidity 0.8.28;
|
||||
|
||||
import "src/contract/main.sol";
|
||||
import "forge-std/Test.sol";
|
||||
|
||||
contract mainTest is Test, scoreStore {
|
||||
function testUp() public {
|
||||
up(2);
|
||||
assertEq(test, 2);
|
||||
contract scoreStoreTest is Test {
|
||||
scoreStore scoreS;
|
||||
address nonOwner = address(1);
|
||||
|
||||
function setUp() public {
|
||||
scoreS = new scoreStore();
|
||||
}
|
||||
|
||||
function testAddScore() public {
|
||||
uint id = scoreS.addScore("omg", "test", 5, 8);
|
||||
|
||||
score memory s = scoreS.getScore(id);
|
||||
assertEq(s.p1, "omg");
|
||||
assertEq(s.p2, "test");
|
||||
assertEq(s.p1Score, 5);
|
||||
assertEq(s.p2Score, 8);
|
||||
|
||||
id = scoreS.addScore("ahhhhh", "test", 5, 8);
|
||||
|
||||
s = scoreS.getScore(id);
|
||||
assertEq(s.p1, "ahhhhh");
|
||||
assertEq(s.p2, "test");
|
||||
assertEq(s.p1Score, 5);
|
||||
assertEq(s.p2Score, 8);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user