From a49aec582b129687cee7d2c87b586a20bceb0c43 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 14 Mar 2021 03:48:05 +0100 Subject: [testing] `ant test.javac6` now passes. yay. --- test/core/src/lombok/AbstractRunTests.java | 2 +- test/core/src/lombok/RunTestsViaDelombok.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'test/core') 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); -- cgit