-
Notifications
You must be signed in to change notification settings - Fork 174
/
StructTest.t.sol
43 lines (31 loc) · 1.12 KB
/
StructTest.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
import "forge-std/Test.sol";
import { MudTest } from "@latticexyz/world/test/MudTest.t.sol";
import { getKeysWithValue } from "@latticexyz/world/src/modules/keyswithvalue/getKeysWithValue.sol";
import { IWorld } from "../src/codegen/world/IWorld.sol";
import { CounterTable, CounterTableTableId } from "../src/codegen/index.sol";
import { BytesStruct, StringStruct } from "../src/systems/structs.sol";
contract StructTest is MudTest {
IWorld world;
function setUp() public override {
super.setUp();
world = IWorld(worldAddress);
}
function testStaticBytes() public {
BytesStruct[1] memory structs;
world.staticArrayBytesStruct(structs);
}
function testDynamicBytes() public {
BytesStruct[] memory structs = new BytesStruct[](1);
world.dynamicArrayBytesStruct(structs);
}
function testStaticString() public {
StringStruct[1] memory structs;
world.staticArrayStringStruct(structs);
}
function testDynamicString() public {
StringStruct[] memory structs = new StringStruct[](1);
world.dynamicArrayStringStruct(structs);
}
}