diff options
Diffstat (limited to 'test/core/src/lombok/AbstractRunTests.java')
-rw-r--r-- | test/core/src/lombok/AbstractRunTests.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java index 91f22502..64956c7f 100644 --- a/test/core/src/lombok/AbstractRunTests.java +++ b/test/core/src/lombok/AbstractRunTests.java @@ -53,14 +53,13 @@ public abstract class AbstractRunTests { String fileName = file.getName(); LombokTestSource expected = LombokTestSource.read(params.getAfterDirectory(), params.getMessagesDirectory(), fileName); - if (expected.isIgnore() || expected.versionWithinLimit(params.getVersion())) return false; + if (expected.isIgnore() || !expected.versionWithinLimit(params.getVersion())) return false; LinkedHashSet<CompilerMessage> messages = new LinkedHashSet<CompilerMessage>(); StringWriter writer = new StringWriter(); transformCode(messages, writer, file, sourceDirectives.getConfLines()); compare(file.getName(), expected, writer.toString(), messages, params.printErrors()); - return true; } @@ -186,15 +185,21 @@ public abstract class AbstractRunTests { private static void compareContent(String name, String expectedFile, String actualFile) { String[] expectedLines = expectedFile.split("(\\r?\\n)"); String[] actualLines = actualFile.split("(\\r?\\n)"); - if (expectedLines[0].startsWith("// Generated by delombok at ")) { - expectedLines[0] = ""; + + for (int i = 0; i < expectedLines.length; i++) { + if (expectedLines[i].isEmpty() || expectedLines[i].startsWith("//")) expectedLines[i] = ""; + else break; } - if (actualLines[0].startsWith("// Generated by delombok at ")) { - actualLines[0] = ""; + for (int i = 0; i < actualLines.length; i++) { + if (actualLines[i].isEmpty() || actualLines[i].startsWith("//")) actualLines[i] = ""; + else break; } expectedLines = removeBlanks(expectedLines); actualLines = removeBlanks(actualLines); + int size = Math.min(expectedLines.length, actualLines.length); + if (size == 0) return; + for (int i = 0; i < size; i++) { String expected = expectedLines[i]; String actual = actualLines[i]; |