aboutsummaryrefslogtreecommitdiff
path: root/test/pretty/resource/before/Switch12.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/pretty/resource/before/Switch12.java')
-rw-r--r--test/pretty/resource/before/Switch12.java30
1 files changed, 30 insertions, 0 deletions
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;
+ }
+}