aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/src/lombok/DirectoryRunner.java2
-rw-r--r--test/pretty/resource/after/Java11Var.java (renamed from test/pretty/resource/after/Java11Var.javva)0
-rw-r--r--test/pretty/resource/after/Switch11.java11
-rw-r--r--test/pretty/resource/after/Switch12.java28
-rw-r--r--test/pretty/resource/before/Switch11.java12
-rw-r--r--test/pretty/resource/before/Switch12.java30
6 files changed, 82 insertions, 1 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java
index ea15cdb9..9410b4c7 100644
--- a/test/core/src/lombok/DirectoryRunner.java
+++ b/test/core/src/lombok/DirectoryRunner.java
@@ -91,7 +91,7 @@ public class DirectoryRunner extends Runner {
public DirectoryRunner(Class<?> testClass) throws Exception {
description = Description.createSuiteDescription(testClass);
- this.params = (TestParams) testClass.newInstance();
+ this.params = (TestParams) testClass.getConstructor().newInstance();
Throwable error = null;
try {
diff --git a/test/pretty/resource/after/Java11Var.javva b/test/pretty/resource/after/Java11Var.java
index cec4be6d..cec4be6d 100644
--- a/test/pretty/resource/after/Java11Var.javva
+++ b/test/pretty/resource/after/Java11Var.java
diff --git a/test/pretty/resource/after/Switch11.java b/test/pretty/resource/after/Switch11.java
new file mode 100644
index 00000000..d24012a2
--- /dev/null
+++ b/test/pretty/resource/after/Switch11.java
@@ -0,0 +1,11 @@
+public class Switch11 {
+ public void basic() {
+ switch (5) {
+ case 1:
+ case 2:
+ System.out.println("OK");
+ break;
+ default:
+ }
+ }
+}
diff --git a/test/pretty/resource/after/Switch12.java b/test/pretty/resource/after/Switch12.java
new file mode 100644
index 00000000..89825223
--- /dev/null
+++ b/test/pretty/resource/after/Switch12.java
@@ -0,0 +1,28 @@
+public class Switch12 {
+ public void basic() {
+ switch (5) {
+ case 1:
+ case 2:
+ System.out.println("OK");
+ break;
+ default:
+ }
+ }
+ public void multiCase() {
+ switch (5) {
+ case 1, 2:
+ System.out.println("OK");
+ default:
+ }
+ }
+
+ public int switchExpr() {
+ return switch (5) {
+ case 1, 2 -> 0;
+ case 3 -> {
+ break 10;
+ }
+ default -> 10;
+ } + 10;
+ }
+}
diff --git a/test/pretty/resource/before/Switch11.java b/test/pretty/resource/before/Switch11.java
new file mode 100644
index 00000000..556631f0
--- /dev/null
+++ b/test/pretty/resource/before/Switch11.java
@@ -0,0 +1,12 @@
+// version :11
+public class Switch11 {
+ public void basic() {
+ switch (5) {
+ case 1:
+ case 2:
+ System.out.println("OK");
+ break;
+ default:
+ }
+ }
+}
diff --git a/test/pretty/resource/before/Switch12.java b/test/pretty/resource/before/Switch12.java
new file mode 100644
index 00000000..f1bd8a79
--- /dev/null
+++ b/test/pretty/resource/before/Switch12.java
@@ -0,0 +1,30 @@
+// version 12:
+public class Switch12 {
+ public void basic() {
+ switch (5) {
+ case 1:
+ case 2:
+ System.out.println("OK");
+ break;
+ default:
+ }
+ }
+
+ public void multiCase() {
+ switch (5) {
+ case 1, 2:
+ System.out.println("OK");
+ default:
+ }
+ }
+
+ public int switchExpr() {
+ return switch (5) {
+ case 1, 2 -> 0;
+ case 3 -> {
+ break 10;
+ }
+ default -> 10;
+ } + 10;
+ }
+}