Skip to content

Commit 803af09

Browse files
committed
Update test mixed filenames to better show what they are, fix tests
1 parent 4dbab2e commit 803af09

File tree

5 files changed

+59
-8
lines changed

5 files changed

+59
-8
lines changed

src/test/java/dev/compactmods/crafting/tests/recipes/layers/MixedLayerTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class MixedLayerTests {
2121
@Test
2222
@Tag("minecraft")
2323
void CanCreateLayerInstance() {
24-
JsonElement layerJson = FileHelper.INSTANCE.getJsonFromFile("layers/mixed/mixed.json");
24+
JsonElement layerJson = FileHelper.INSTANCE.getJsonFromFile("layers/mixed/basic.json");
2525

2626
DataResult<MixedComponentRecipeLayer> parsed = MixedComponentRecipeLayer.CODEC.parse(JsonOps.INSTANCE, layerJson);
2727
parsed.resultOrPartial(Assertions::fail)

src/test/java/dev/compactmods/crafting/tests/recipes/layers/RecipeLayerUtilTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ public class RecipeLayerUtilTests {
1818
@Test
1919
@Tag("minecraft")
2020
void CanRotate() {
21-
TestRecipeLayerBlocks harness = getHarness("layers/mixed/mixed_basic.json");
21+
TestRecipeLayerBlocks harness = getHarness("layers/mixed/basic_harness.json");
2222
Assertions.assertNotNull(harness);
2323

2424
final IRecipeLayerBlocks rotatedClockwise = RecipeLayerUtil.rotate(harness, Rotation.CLOCKWISE_90);
2525
Assertions.assertNotNull(rotatedClockwise);
2626

27-
final Set<BlockPos> originalPositions = harness.getPositionsForComponent("Go").map(BlockPos::immutable).collect(Collectors.toSet());
28-
final Set<BlockPos> rotatedPositions = rotatedClockwise.getPositionsForComponent("Go").map(BlockPos::immutable).collect(Collectors.toSet());
27+
final Set<BlockPos> originalPositions = harness.getPositionsForComponent("G").map(BlockPos::immutable).collect(Collectors.toSet());
28+
final Set<BlockPos> rotatedPositions = rotatedClockwise.getPositionsForComponent("G").map(BlockPos::immutable).collect(Collectors.toSet());
2929

3030
Assertions.assertNotEquals(originalPositions, rotatedPositions);
3131
}
3232

3333
@Test
3434
@Tag("minecraft")
3535
void CanRotateWithUnknownComponent() {
36-
TestRecipeLayerBlocks harness = getHarness("layers/mixed/mixed_unknown_basic.json");
36+
TestRecipeLayerBlocks harness = getHarness("layers/mixed/unknown_component.json");
3737
Assertions.assertNotNull(harness);
3838

3939
boolean identified = harness.allIdentified();
@@ -55,14 +55,14 @@ void CanRotateWithUnknownComponent() {
5555
@Test
5656
@Tag("minecraft")
5757
void NonRotationCreatesCopiedInstance() {
58-
TestRecipeLayerBlocks harness = getHarness("layers/mixed/mixed_basic.json");
58+
TestRecipeLayerBlocks harness = getHarness("layers/mixed/basic_harness.json");
5959
Assertions.assertNotNull(harness);
6060

6161
final IRecipeLayerBlocks rotatedHarness = RecipeLayerUtil.rotate(harness, Rotation.NONE);
6262
Assertions.assertNotNull(rotatedHarness);
6363

64-
final Set<BlockPos> originalPositions = harness.getPositionsForComponent("Go").map(BlockPos::immutable).collect(Collectors.toSet());
65-
final Set<BlockPos> rotatedPositions = rotatedHarness.getPositionsForComponent("Go").map(BlockPos::immutable).collect(Collectors.toSet());
64+
final Set<BlockPos> originalPositions = harness.getPositionsForComponent("G").map(BlockPos::immutable).collect(Collectors.toSet());
65+
final Set<BlockPos> rotatedPositions = rotatedHarness.getPositionsForComponent("G").map(BlockPos::immutable).collect(Collectors.toSet());
6666

6767
Assertions.assertEquals(originalPositions, rotatedPositions);
6868

File renamed without changes.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"world": {
3+
"type": "compactcrafting:mixed",
4+
"pattern": [
5+
["I", "G", "G", "G", "G"],
6+
["G", "-", "-", "-", "G"],
7+
["G", "-", "O", "-", "G"],
8+
["G", "-", "-", "-", "G"],
9+
["G", "G", "G", "G", "G"]
10+
]
11+
},
12+
"worldBlocks": {
13+
"G": {
14+
"type": "compactcrafting:block",
15+
"block": "minecraft:glass"
16+
},
17+
"O": {
18+
"type": "compactcrafting:block",
19+
"block": "minecraft:obsidian"
20+
},
21+
"I": {
22+
"type": "compactcrafting:block",
23+
"block": "minecraft:iron_block"
24+
}
25+
},
26+
27+
"layer": {
28+
"type": "compactcrafting:mixed",
29+
"pattern": [
30+
["I", "G", "G", "G", "G"],
31+
["G", "-", "-", "-", "G"],
32+
["G", "-", "O", "-", "G"],
33+
["G", "-", "-", "-", "G"],
34+
["G", "G", "G", "G", "G"]
35+
]
36+
},
37+
"components": {
38+
"G": {
39+
"type": "compactcrafting:block",
40+
"block": "minecraft:glass"
41+
},
42+
"O": {
43+
"type": "compactcrafting:block",
44+
"block": "minecraft:obsidian"
45+
},
46+
"I": {
47+
"type": "compactcrafting:block",
48+
"block": "minecraft:iron_block"
49+
}
50+
}
51+
}

src/test/resources/layers/mixed/mixed_unknown_basic.json renamed to src/test/resources/layers/mixed/unknown_component.json

File renamed without changes.

0 commit comments

Comments
 (0)