aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/LombokTestSource.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/src/lombok/LombokTestSource.java')
-rw-r--r--test/core/src/lombok/LombokTestSource.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index 1f3f5e1a..cd7cd166 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -51,6 +51,7 @@ public class LombokTestSource {
private final Map<String, String> formatPreferences;
private final boolean ignore;
private final boolean skipCompareContent;
+ private final boolean unchanged;
private final int versionLowerLimit, versionUpperLimit;
private final ConfigurationResolver configuration;
private final String specifiedEncoding;
@@ -75,6 +76,10 @@ public class LombokTestSource {
return ignore;
}
+ public boolean forceUnchanged() {
+ return unchanged;
+ }
+
public boolean isSkipCompareContent() {
return skipCompareContent;
}
@@ -124,6 +129,7 @@ public class LombokTestSource {
}
private static final Pattern IGNORE_PATTERN = Pattern.compile("^\\s*ignore\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
+ private static final Pattern UNCHANGED_PATTERN = Pattern.compile("^\\s*unchanged\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern SKIP_COMPARE_CONTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?compare[- ]?content\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private LombokTestSource(File file, String content, List<CompilerMessageMatcher> messages, List<String> directives) {
@@ -136,6 +142,7 @@ public class LombokTestSource {
int versionUpper = Integer.MAX_VALUE;
boolean ignore = false;
boolean skipCompareContent = false;
+ boolean unchanged = false;
String encoding = null;
Map<String, String> formats = new HashMap<String, String>();
@@ -147,6 +154,11 @@ public class LombokTestSource {
continue;
}
+ if (UNCHANGED_PATTERN.matcher(directive).matches()) {
+ unchanged = true;
+ continue;
+ }
+
if (SKIP_COMPARE_CONTENT_PATTERN.matcher(directive).matches()) {
skipCompareContent = true;
continue;
@@ -194,6 +206,7 @@ public class LombokTestSource {
this.versionUpperLimit = versionUpper;
this.ignore = ignore;
this.skipCompareContent = skipCompareContent;
+ this.unchanged = unchanged;
ConfigurationProblemReporter reporter = new ConfigurationProblemReporter() {
@Override public void report(String sourceDescription, String problem, int lineNumber, CharSequence line) {
Assert.fail("Problem on directive line: " + problem + " at conf line #" + lineNumber + " (" + line + ")");