77import java .nio .file .Files ;
88import java .nio .file .Path ;
99
10+ import static org .quiltmc .enigma .TestUtil .toNewLineEndings ;
11+
1012public class DropInvalidMappingsTest extends CommandTest {
1113 private static final Path LONE_JAR = TestUtil .obfJar ("lone_class" );
1214 private static final Path INNER_JAR = TestUtil .obfJar ("inner_classes" );
@@ -31,8 +33,8 @@ public void testInvalidMappings() throws Exception {
3133
3234 DropInvalidMappingsCommand .run (LONE_JAR , INVALID_MAPPINGS_INPUT , resultFile );
3335
34- String expectedLines = Files .readString (INVALID_MAPPINGS_EXPECTED );
35- String actualLines = Files .readString (resultFile );
36+ String expectedLines = toNewLineEndings ( Files .readString (INVALID_MAPPINGS_EXPECTED ) );
37+ String actualLines = toNewLineEndings ( Files .readString (resultFile ) );
3638
3739 Assertions .assertEquals (expectedLines , actualLines );
3840 }
@@ -55,8 +57,8 @@ public void testMappingSave() throws Exception {
5557
5658 DropInvalidMappingsCommand .run (INNER_JAR , MAPPING_SAVE_INPUT , resultFile );
5759
58- String expectedLines = Files .readString (MAPPING_SAVE_EXPECTED );
59- String actualLines = Files .readString (resultFile );
60+ String expectedLines = toNewLineEndings ( Files .readString (MAPPING_SAVE_EXPECTED ) );
61+ String actualLines = toNewLineEndings ( Files .readString (resultFile ) );
6062
6163 Assertions .assertEquals (expectedLines , actualLines );
6264 }
@@ -67,8 +69,8 @@ public void testDiscardInnerClass() throws Exception {
6769
6870 DropInvalidMappingsCommand .run (INNER_JAR , DISCARD_INNER_CLASS_INPUT , resultFile );
6971
70- String expectedLines = Files .readString (DISCARD_INNER_CLASS_EXPECTED );
71- String actualLines = Files .readString (resultFile );
72+ String expectedLines = toNewLineEndings ( Files .readString (DISCARD_INNER_CLASS_EXPECTED ) );
73+ String actualLines = toNewLineEndings ( Files .readString (resultFile ) );
7274
7375 Assertions .assertEquals (expectedLines , actualLines );
7476 }
@@ -79,8 +81,8 @@ public void testEnums() throws Exception {
7981
8082 DropInvalidMappingsCommand .run (ENUMS_JAR , ENUMS_INPUT , resultFile );
8183
82- String expectedLines = Files .readString (ENUMS_EXPECTED );
83- String actualLines = Files .readString (resultFile );
84+ String expectedLines = toNewLineEndings ( Files .readString (ENUMS_EXPECTED ) );
85+ String actualLines = toNewLineEndings ( Files .readString (resultFile ) );
8486
8587 Assertions .assertEquals (expectedLines , actualLines );
8688 }
0 commit comments