diff options
author | Linnea Gräf <nea@nea.moe> | 2024-03-01 00:43:28 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-03-01 00:43:28 +0100 |
commit | b8c7e6c934ae9e0059ac1ac1455d77319dbc20c0 (patch) | |
tree | c6be858ae9bb4813f900e4832a3fba108b43c1c4 /src/test/java/moe/nea | |
download | zwirn-b8c7e6c934ae9e0059ac1ac1455d77319dbc20c0.tar.gz zwirn-b8c7e6c934ae9e0059ac1ac1455d77319dbc20c0.tar.bz2 zwirn-b8c7e6c934ae9e0059ac1ac1455d77319dbc20c0.zip |
Create merger
Diffstat (limited to 'src/test/java/moe/nea')
-rw-r--r-- | src/test/java/moe/nea/zwirn/ZwirnTest.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/test/java/moe/nea/zwirn/ZwirnTest.java b/src/test/java/moe/nea/zwirn/ZwirnTest.java new file mode 100644 index 0000000..2f80964 --- /dev/null +++ b/src/test/java/moe/nea/zwirn/ZwirnTest.java @@ -0,0 +1,51 @@ +package moe.nea.zwirn; + +import net.fabricmc.stitch.commands.tinyv2.*; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; + +class ZwirnTest { + + @Test + void mergeTinyFile() throws IOException { + var base = new TinyFile( + new TinyHeader( + Arrays.asList("official", "intermediary", "named"), + 2, 0, new HashMap<>() + ), + Arrays.asList( + new TinyClass( + Arrays.asList("A", "ClassA", "SomeClass"), + Arrays.asList(), + Arrays.asList(new TinyField("a", + Arrays.asList("a", "field_a", "myField"), Arrays.asList("Field comment"))), + Arrays.asList("some comment") + ) + ) + ); + var overlay = new TinyFile( + new TinyHeader( + Arrays.asList("official", "intermediary", "named"), + 2, 0, new HashMap<>() + ), + Arrays.asList( + new TinyClass( + Arrays.asList("A", "A", "SomeClassButNamedBetter"), + Arrays.asList(), + Arrays.asList(new TinyField("a", + Arrays.asList("a", "a", "myFieldButNamedCool"), Arrays.asList("Better comment"))), + Arrays.asList() + ), + new TinyClass( + Arrays.asList("B", "B", "OtherClass") + ) + ) + ); + var merged = Zwirn.mergeTinyFile(base, overlay, "official"); + TinyV2Writer.write(merged, Path.of("out.tiny")); + } +}
\ No newline at end of file |