mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 14:00:26 +00:00
Isolated datapack format test
- The default forced datapack format test unbinds the platform so loader test harnesses that bind a runtime cannot change its result
This commit is contained in:
1 parent
79e7b0c79e
commit
0073002b57
1 file changed
+5
+5
@@ -58,7 +58,9 @@ import static org.mockito.Mockito.when;
|
|||||||
public class ModdedForcedDatapackTest {
|
public class ModdedForcedDatapackTest {
|
||||||
@Test
|
@Test
|
||||||
public void metadataUses263DataFormat() throws IOException {
|
public void metadataUses263DataFormat() throws IOException {
|
||||||
|
IrisPlatform previous = IrisPlatforms.getOrNull();
|
||||||
Path packDirectory = Files.createTempDirectory("iris-modded-pack-format");
|
Path packDirectory = Files.createTempDirectory("iris-modded-pack-format");
|
||||||
|
IrisPlatforms.unbind();
|
||||||
try {
|
try {
|
||||||
ModdedForcedDatapack.writePackMeta(packDirectory);
|
ModdedForcedDatapack.writePackMeta(packDirectory);
|
||||||
JSONObject pack = new JSONObject(Files.readString(packDirectory.resolve("pack.mcmeta")))
|
JSONObject pack = new JSONObject(Files.readString(packDirectory.resolve("pack.mcmeta")))
|
||||||
@@ -67,6 +69,9 @@ public class ModdedForcedDatapackTest {
|
|||||||
assertEquals(121, pack.getInt("min_format"));
|
assertEquals(121, pack.getInt("min_format"));
|
||||||
assertEquals(121, pack.getInt("max_format"));
|
assertEquals(121, pack.getInt("max_format"));
|
||||||
} finally {
|
} finally {
|
||||||
|
if (previous != null) {
|
||||||
|
IrisPlatforms.bind(previous);
|
||||||
|
}
|
||||||
deleteTree(packDirectory);
|
deleteTree(packDirectory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user