Skip to content

Commit

Permalink
smash the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfudge authored and sfPlayer1 committed Nov 4, 2019
1 parent 9010d52 commit 83a83ed
Show file tree
Hide file tree
Showing 21 changed files with 508 additions and 942,718 deletions.
10 changes: 8 additions & 2 deletions src/test/java/net/fabricmc/stitch/tinyv2/Snapshot37a.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package net.fabricmc.stitch.tinyv2;

import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

import org.junit.jupiter.api.Test;

public class Snapshot37a {
private static final String DIR = new File(Stable1_14_4.class.getClassLoader().getResource("/snapshot-37a").getPath()).getAbsolutePath() + "/";

private static final String DIR = new File(Snapshot37a.class.getClassLoader().getResource("snapshot-37a").getPath()).getAbsolutePath() + "/";
//
@Test
public void testMerge() throws Exception {
Commands.merge(DIR + "intermediate-mappings-inverted-stitch.tinyv2",
Expand All @@ -25,12 +28,15 @@ public void testReorder2() throws Exception {

@Test
public void testReorder3() throws Exception {
Commands.reorder(DIR + "merged-unordered.tinyv2",
String path = DIR + "merged-unordered.tinyv2";
if(!Files.exists(Paths.get(path))) testMerge();
Commands.reorder(path,
DIR + "merged.tinyv2",
"official", "intermediary", "named"
);
}

/** You need the 19w37a-merged.jar file under local/ */
@Test
public void testFieldNameProposal() throws Exception {
Commands.proposeFieldNames("local/19w37a-merged.jar",
Expand Down
9 changes: 0 additions & 9 deletions src/test/java/net/fabricmc/stitch/tinyv2/Stable1_14_4.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ public void testMerge() throws Exception {
);
try (BufferedReader reader = Files.newBufferedReader(Paths.get(target))) {
TinyTree mappings = TinyMappingFactory.load(reader);
ClassDef class_2843$class_2845$1 = findClassMapping("intermediary",
"net/minecraft/class_2843$class_2845$1", mappings);

Assertions.assertEquals("net/minecraft/world/chunk/UpgradeData$class_2845$1",
class_2843$class_2845$1.getName("named"));

ClassDef class_481$class_482 = findClassMapping("intermediary", "net/minecraft/class_481$class_482", mappings);
Assertions.assertEquals("net/minecraft/client/gui/screen/ingame/CreativeInventoryScreen$class_482",
class_481$class_482.getName("named"));

ParameterDef blockInitParam = findMethodParameterMapping("intermediary", "net/minecraft/class_2248",
"<init>", "(Lnet/minecraft/class_2248$class_2251;)V", 1, mappings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private void tryToReadAndWrite(String path) throws IOException {
String writtenIntMappings = new String(Files.readAllBytes(tempLocation));

// Ensure the file has not changed
Assertions.assertEquals(originalIntMappings, writtenIntMappings);
Assertions.assertEquals(originalIntMappings.replace("\r\n","\n"), writtenIntMappings.replace("\r\n","\n"));

}

Expand Down
Loading

0 comments on commit 83a83ed

Please sign in to comment.