aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-14 03:48:05 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2021-03-14 03:48:05 +0100
commita49aec582b129687cee7d2c87b586a20bceb0c43 (patch)
tree73b128a77d8f7d06880ae8d9d830ceb3e422eaf0 /test
parent58ff1482e3d6ac68aa76afd82995fd2ef5a17be6 (diff)
downloadlombok-a49aec582b129687cee7d2c87b586a20bceb0c43.tar.gz
lombok-a49aec582b129687cee7d2c87b586a20bceb0c43.tar.bz2
lombok-a49aec582b129687cee7d2c87b586a20bceb0c43.zip
[testing] `ant test.javac6` now passes. yay.
Diffstat (limited to 'test')
-rw-r--r--test/core/src/lombok/AbstractRunTests.java2
-rw-r--r--test/core/src/lombok/RunTestsViaDelombok.java8
-rw-r--r--test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java1
-rw-r--r--test/transform/resource/after-delombok/NullLibrary2.java1
-rw-r--r--test/transform/resource/after-delombok/ValWeirdTypes.java1
-rw-r--r--test/transform/resource/after-delombok/WithPlain.java1
-rw-r--r--test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java1
-rw-r--r--test/transform/resource/before/BuilderSingularNullBehavior2.java2
-rw-r--r--test/transform/resource/before/NullLibrary2.java1
-rw-r--r--test/transform/resource/before/SuperBuilderCustomized.java1
-rw-r--r--test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java3
-rw-r--r--test/transform/resource/before/ValWeirdTypes.java1
-rw-r--r--test/transform/resource/before/WithPlain.java1
13 files changed, 20 insertions, 4 deletions
diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java
index c3a16336..51ec41c5 100644
--- a/test/core/src/lombok/AbstractRunTests.java
+++ b/test/core/src/lombok/AbstractRunTests.java
@@ -92,7 +92,7 @@ public abstract class AbstractRunTests {
}
});
- boolean checkPositions = !(params instanceof TestLombokFilesIdempotent || params instanceof TestSourceFiles);
+ boolean checkPositions = !(params instanceof TestLombokFilesIdempotent || params instanceof TestSourceFiles) && !sourceDirectives_.isSkipCompareContent();
boolean changed = transformCode(messages, writer, file, sourceDirectives_.getSpecifiedEncoding(), sourceDirectives_.getFormatPreferences(), sourceDirectives_.minVersion(), checkPositions);
boolean forceUnchanged = sourceDirectives_.forceUnchanged() || sourceDirectives_.isSkipCompareContent();
diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java
index 860c62d6..13acdf55 100644
--- a/test/core/src/lombok/RunTestsViaDelombok.java
+++ b/test/core/src/lombok/RunTestsViaDelombok.java
@@ -134,9 +134,15 @@ public class RunTestsViaDelombok extends AbstractRunTests {
// Given status of j6/j7, not worth properly testing.
check = false;
}
+ if (version < 8 && tree instanceof JCIdent) {
+ // explicit `super()` invocations do not appear to have end pos in j6/7.
+ if ("super".equals("" + ((JCIdent) tree).name)) check = false;
+ }
if (check && tree.pos == -1) fail(craftFailMsg("Start", astContext));
- if (check && Javac.getEndPosition(tree, unit) == -1) fail(craftFailMsg("End", astContext));
+ if (check && Javac.getEndPosition(tree, unit) == -1) {
+ fail(craftFailMsg("End", astContext));
+ }
} finally {
astContext.push(tree);
super.scan(tree);
diff --git a/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java b/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java
index e70877bf..5f605de4 100644
--- a/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java
+++ b/test/transform/resource/after-delombok/BuilderSingularNullBehavior2.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
import java.util.List;
class BuilderSingularNullBehavior2 {
private List<String> locations;
diff --git a/test/transform/resource/after-delombok/NullLibrary2.java b/test/transform/resource/after-delombok/NullLibrary2.java
index 5087e4ee..fec143c2 100644
--- a/test/transform/resource/after-delombok/NullLibrary2.java
+++ b/test/transform/resource/after-delombok/NullLibrary2.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
public class NullLibrary2 {
String foo;
@java.lang.Override
diff --git a/test/transform/resource/after-delombok/ValWeirdTypes.java b/test/transform/resource/after-delombok/ValWeirdTypes.java
index bc18fdac..b3ecfc49 100644
--- a/test/transform/resource/after-delombok/ValWeirdTypes.java
+++ b/test/transform/resource/after-delombok/ValWeirdTypes.java
@@ -1,3 +1,4 @@
+// version 8: In java6/7, lub types worked differently, so, the `arraysAsList` method has a slightly different inferred type there.
import java.math.BigDecimal;
import java.util.*;
public class ValWeirdTypes<Z> {
diff --git a/test/transform/resource/after-delombok/WithPlain.java b/test/transform/resource/after-delombok/WithPlain.java
index 547c6fb9..6a1c46e6 100644
--- a/test/transform/resource/after-delombok/WithPlain.java
+++ b/test/transform/resource/after-delombok/WithPlain.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
class WithPlain {
int i;
final int foo;
diff --git a/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java b/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java
index cf4bd91b..e1adccb5 100644
--- a/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java
+++ b/test/transform/resource/after-ecj/BuilderSingularNullBehavior2.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
import java.util.List;
import lombok.Singular;
@lombok.Builder class BuilderSingularNullBehavior2 {
diff --git a/test/transform/resource/before/BuilderSingularNullBehavior2.java b/test/transform/resource/before/BuilderSingularNullBehavior2.java
index 544a270d..dde4eea9 100644
--- a/test/transform/resource/before/BuilderSingularNullBehavior2.java
+++ b/test/transform/resource/before/BuilderSingularNullBehavior2.java
@@ -1,4 +1,4 @@
-//version 8:
+//version 8: springframework dep is too new to run on j6
//CONF: lombok.addNullAnnotations = spring
//CONF: lombok.nonNull.exceptionType = JDK
import java.util.List;
diff --git a/test/transform/resource/before/NullLibrary2.java b/test/transform/resource/before/NullLibrary2.java
index 17b1e6e0..6b0ce4b0 100644
--- a/test/transform/resource/before/NullLibrary2.java
+++ b/test/transform/resource/before/NullLibrary2.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
//CONF: lombok.addNullAnnotations = spring
@lombok.EqualsAndHashCode
@lombok.ToString
diff --git a/test/transform/resource/before/SuperBuilderCustomized.java b/test/transform/resource/before/SuperBuilderCustomized.java
index 8e641d90..652d0865 100644
--- a/test/transform/resource/before/SuperBuilderCustomized.java
+++ b/test/transform/resource/before/SuperBuilderCustomized.java
@@ -1,3 +1,4 @@
+//version 8: Javac 6 will error out due to `ChildBuilder` not existing before properly running lombok. Giving j6 support status, not worth fixing.
import java.util.List;
public class SuperBuilderCustomized {
diff --git a/test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java b/test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java
index d52cbded..1d75c6fb 100644
--- a/test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java
+++ b/test/transform/resource/before/SuperBuilderWithCustomBuilderMethod.java
@@ -1,4 +1,5 @@
-import java.util.List;
+//version 8: Javac 6 will error out due to `ChildBuilder` not existing before properly running lombok. Giving j6 support status, not worth fixing.
+iimport java.util.List;
public class SuperBuilderWithCustomBuilderMethod {
@lombok.experimental.SuperBuilder
diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java
index 8dd63e86..f62feca6 100644
--- a/test/transform/resource/before/ValWeirdTypes.java
+++ b/test/transform/resource/before/ValWeirdTypes.java
@@ -1,3 +1,4 @@
+// version 8: In java6/7, lub types worked differently, so, the `arraysAsList` method has a slightly different inferred type there.
import java.math.BigDecimal;
import java.util.*;
import lombok.val;
diff --git a/test/transform/resource/before/WithPlain.java b/test/transform/resource/before/WithPlain.java
index 4f048242..9be8d4d5 100644
--- a/test/transform/resource/before/WithPlain.java
+++ b/test/transform/resource/before/WithPlain.java
@@ -1,3 +1,4 @@
+//version 8: springframework dep is too new to run on j6
//CONF: lombok.addNullAnnotations = spring
import lombok.With;
class WithPlain {