aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-10-26 03:49:23 +0200
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-10-26 03:49:23 +0200
commitc359a4b41f2800c63ad28037fe02ccf8910dcc2e (patch)
tree901022e69c75f52661a400f157cb7661e9496ce9 /test
parent7c8ba501deea24694e2502747b63aa6dab503c79 (diff)
downloadlombok-c359a4b41f2800c63ad28037fe02ccf8910dcc2e.tar.gz
lombok-c359a4b41f2800c63ad28037fe02ccf8910dcc2e.tar.bz2
lombok-c359a4b41f2800c63ad28037fe02ccf8910dcc2e.zip
[issue #3014] test-case that reproduces this problem.
Diffstat (limited to 'test')
-rw-r--r--test/core/src/lombok/DirectoryRunner.java1
-rw-r--r--test/core/src/lombok/LombokTestSource.java4
-rw-r--r--test/transform/resource/before/BuilderNestedInEnum.java12
3 files changed, 17 insertions, 0 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java
index 53347e24..65e5e002 100644
--- a/test/core/src/lombok/DirectoryRunner.java
+++ b/test/core/src/lombok/DirectoryRunner.java
@@ -40,6 +40,7 @@ import lombok.javac.Javac;
public class DirectoryRunner extends Runner {
/** Add 1 or more file names to reduce the testset to just the named file(s). No files = test it all. */
private static final List<String> DEBUG_FOCUS_ON_FILE = Arrays.asList(
+ "BuilderNestedInEnum.java"
);
public enum Compiler {
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index 0326dee9..27ffc31a 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -161,6 +161,7 @@ public class LombokTestSource {
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[- ]?contents?\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
private static final Pattern SKIP_IDEMPOTENT_PATTERN = Pattern.compile("^\\s*skip[- ]?idempotent\\s*(?:[-:].*)?$", Pattern.CASE_INSENSITIVE);
+ private static final Pattern ISSUE_REF_PATTERN = Pattern.compile("^\\s*issue #?\\d+(:?\\s+.*)?$", Pattern.CASE_INSENSITIVE);
private LombokTestSource(File file, String content, List<CompilerMessageMatcher> messages, List<String> directives) {
this.file = file;
@@ -200,6 +201,9 @@ public class LombokTestSource {
skipIdempotent = true;
continue;
}
+ if (ISSUE_REF_PATTERN.matcher(directive).matches()) {
+ continue;
+ }
if (lc.startsWith("platform ")) {
String platformDesc = lc.substring("platform ".length());
diff --git a/test/transform/resource/before/BuilderNestedInEnum.java b/test/transform/resource/before/BuilderNestedInEnum.java
new file mode 100644
index 00000000..99348002
--- /dev/null
+++ b/test/transform/resource/before/BuilderNestedInEnum.java
@@ -0,0 +1,12 @@
+// issue #3014: Builder check if its on a non-static inner class and errors if it is. But it was erroring here even though it is on a static inner class.
+class BuilderNestedInEnum {
+ public enum TestEnum {
+ FOO, BAR;
+
+ @lombok.Builder
+ @lombok.Value
+ public static class TestBuilder {
+ String field;
+ }
+ }
+} \ No newline at end of file