aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/AbstractRunTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/src/lombok/AbstractRunTests.java')
-rw-r--r--test/core/src/lombok/AbstractRunTests.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java
index 2f3f0988..e84aec0d 100644
--- a/test/core/src/lombok/AbstractRunTests.java
+++ b/test/core/src/lombok/AbstractRunTests.java
@@ -225,8 +225,8 @@ public abstract class AbstractRunTests {
actualLines = removeBlanks(actualLines);
int size = Math.min(expectedLines.length, actualLines.length);
for (int i = 0; i < size; i++) {
- String expected = expectedLines[i];
- String actual = actualLines[i];
+ String expected = trimRight(expectedLines[i]);
+ String actual = trimRight(actualLines[i]);
assertEquals(String.format("Difference in %s on line %d", name, i + 1), expected, actual);
}
if (expectedLines.length > actualLines.length) {
@@ -237,6 +237,15 @@ public abstract class AbstractRunTests {
}
}
+ private static String trimRight(String in) {
+ int endIdx = in.length() - 1;
+ while (endIdx > -1 && Character.isWhitespace(in.charAt(endIdx))) {
+ endIdx--;
+ }
+
+ return in.substring(0, endIdx);
+ }
+
private static String[] removeBlanks(String[] in) {
List<String> out = new ArrayList<String>();
for (String s : in) {