mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[tests] more cases for enhanced switch statements highlighting tests
This commit is contained in:
+7
@@ -57,10 +57,15 @@ class EnhancedSwitchStatements {
|
||||
case "" == "" + "" ? 3 : 0 -> noop();
|
||||
}
|
||||
|
||||
switch (E.valueOf("E1")) {
|
||||
case E1 -> noop();
|
||||
}
|
||||
|
||||
switch (E.valueOf("E1")) {
|
||||
case <error descr="Constant expression required">null</error> -> noop();
|
||||
case <error descr="An enum switch case label must be the unqualified name of an enumeration constant">E.E1</error> -> noop();
|
||||
case E2 -> noop();
|
||||
case <error descr="Incompatible types. Found: 'int', required: 'EnhancedSwitchStatements.E'">1</error> -> noop();
|
||||
}
|
||||
|
||||
switch (new Random().nextInt()) {
|
||||
@@ -73,6 +78,8 @@ class EnhancedSwitchStatements {
|
||||
case 3, <error descr="Duplicate label '2'">2</error>:
|
||||
noop(); break;
|
||||
}
|
||||
|
||||
switch (<error descr="Incompatible types. Found: 'java.lang.Object', required: 'char, byte, short, int, Character, Byte, Short, Integer, String, or an enum'">new Object()</error>) { }
|
||||
}
|
||||
|
||||
private static void noop() { }
|
||||
|
||||
Reference in New Issue
Block a user