Skip to content

Commit 3b24f43

Browse files
committed
Java 21 test
1 parent 53cae68 commit 3b24f43

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

java/ql/test/library-tests/dataflow/switchexpr/TestSwitchExpr.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ void test(String s) {
2222
};
2323
sink(x4);
2424
}
25+
26+
static String f(Object x) {
27+
return switch (x) {
28+
case null, default -> "v";
29+
};
30+
}
2531
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//semmle-extractor-options: --javac-args -source 14 -target 14
1+
//semmle-extractor-options: --javac-args -source 21 -target 21

java/ql/test/library-tests/dataflow/switchexpr/switchcasearrows.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
exprs
22
| TestSwitchExpr.java:9:13:9:41 | case ... | TestSwitchExpr.java:9:43:9:46 | null |
33
| TestSwitchExpr.java:10:13:10:22 | default | TestSwitchExpr.java:10:24:10:25 | x1 |
4+
| TestSwitchExpr.java:28:13:28:33 | case null, default | TestSwitchExpr.java:28:35:28:37 | "v" |
45
| TestSwitchExprStmtConsistency.java:10:7:10:15 | case ... | TestSwitchExprStmtConsistency.java:10:17:10:19 | f(...) |
56
| TestSwitchExprStmtConsistency.java:11:7:11:15 | case ... | TestSwitchExprStmtConsistency.java:11:17:11:19 | f(...) |
67
| TestSwitchExprStmtConsistency.java:12:7:12:16 | default | TestSwitchExprStmtConsistency.java:12:18:12:20 | f(...) |

0 commit comments

Comments
 (0)