diff options
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/src/lombok/AbstractRunTests.java | 13 | ||||
-rw-r--r-- | test/core/src/lombok/RunTestsViaEcj.java | 3 |
2 files changed, 13 insertions, 3 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) { diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 586c124a..4f3e2794 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2013 The Project Lombok Authors. + * Copyright (C) 2010-2014 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -70,6 +70,7 @@ public class RunTestsViaEcj extends AbstractRunTests { warnings.put(CompilerOptions.OPTION_ReportUnusedLabel, "ignore"); warnings.put(CompilerOptions.OPTION_ReportUnusedImport, "ignore"); warnings.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, "ignore"); + warnings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7); options.set(warnings); return options; } |