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:
Brian Neumann-Fopiano committed 2026-10-16 11:07:09 -04:00
1 parent 79e7b0c79e
commit 0073002b57
1 file changed
+5
@@ -58,7 +58,9 @@ import static org.mockito.Mockito.when;
public class ModdedForcedDatapackTest {
@Test
public void metadataUses263DataFormat() throws IOException {
IrisPlatform previous = IrisPlatforms.getOrNull();
Path packDirectory = Files.createTempDirectory("iris-modded-pack-format");
IrisPlatforms.unbind();
try {
ModdedForcedDatapack.writePackMeta(packDirectory);
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("max_format"));
} finally {
if (previous != null) {
IrisPlatforms.bind(previous);
}
deleteTree(packDirectory);
}
}