Java: More tests for intention to split switch branch with multiple values into separate branches (IDEA-203895)

This commit is contained in:
Pavel Dolgov
2019-02-04 12:33:41 +03:00
parent 5f7ee5437d
commit cf34272833
4 changed files with 56 additions and 0 deletions
@@ -0,0 +1,15 @@
// "Copy 'switch' branch" "true"
class C {
void foo(int n) {
String s = "";
switch (n) {
case 1:
case 2:
s = "x";
break;
default:
s = "x";
break;
}
}
}
@@ -0,0 +1,15 @@
// "Copy 'switch' branch" "true"
class C {
void foo(int n) {
String s = "";
switch (n) {
default:
case 2:
s = "x";
break;
case 1:
s = "x";
break;
}
}
}
@@ -0,0 +1,13 @@
// "Copy 'switch' branch" "true"
class C {
void foo(int n) {
String s = "";
switch (n) {
case 1:
<caret>default:
case 2:
s = "x";
break;
}
}
}
@@ -0,0 +1,13 @@
// "Copy 'switch' branch" "true"
class C {
void foo(int n) {
String s = "";
switch (n) {
<caret>case 1:
default:
case 2:
s = "x";
break;
}
}
}