From c9f6766b6365b72a155d701c2c5714b181e80a6e Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 21 Dec 2020 17:15:21 +0100 Subject: Run tests if no exclusions match --- test/core/src/lombok/LombokTestSource.java | 13 +++++++++++-- .../resource/before/DelegateOnLocalClass.java | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 test/transform/resource/before/DelegateOnLocalClass.java diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java index e23a0f57..1498e635 100644 --- a/test/core/src/lombok/LombokTestSource.java +++ b/test/core/src/lombok/LombokTestSource.java @@ -65,11 +65,20 @@ public class LombokTestSource { public boolean runOnPlatform(String platform) { if (platforms == null || platforms.isEmpty()) return true; + int inclusiveCount = 0; for (String pl : platforms) { - if (pl.startsWith("!") && pl.regionMatches(true, 1, platform, 0, platform.length())) return false; + if (pl.startsWith("!")) continue; + inclusiveCount++; if (pl.equalsIgnoreCase(platform)) return true; } - return false; + if (inclusiveCount == platforms.size()) { + return false; + } + for (String pl : platforms) { + if (!pl.startsWith("!")) continue; + if (pl.regionMatches(true, 1, platform, 0, platform.length())) return false; + } + return true; } public boolean versionWithinLimit(int version) { diff --git a/test/transform/resource/before/DelegateOnLocalClass.java b/test/transform/resource/before/DelegateOnLocalClass.java new file mode 100644 index 00000000..7376c087 --- /dev/null +++ b/test/transform/resource/before/DelegateOnLocalClass.java @@ -0,0 +1,19 @@ +//platform !eclipse: Requires a 'full' eclipse with intialized workspace, and we don't (yet) have that set up properly in the test run. +//skip compare content +//ignore: crashed javac with NPE, should be enabled when that bug is fixed +import lombok.experimental.Delegate; +import lombok.Getter; + +interface DelegateOnLocalClass { + void test1() { + class DelegateOnStatic { + @Delegate private final java.lang.Runnable field = null; + } + } + + void test2() { + Runnable r = new Runnable() { + @Delegate private final java.lang.Runnable field = null; + } + } +} -- cgit