mirror of
https://github.com/github/codeql.git
synced 2026-04-21 06:55:31 +02:00
Java: Add failing test
This commit is contained in:
@@ -19,5 +19,22 @@ Test.java:
|
||||
# 5| 1: [ConstCase] case ...
|
||||
# 5| -1: [IntegerLiteral] 2
|
||||
# 5| 0: [StringLiteral] "c"
|
||||
# 6| 2: [DefaultCase] default
|
||||
# 6| -1: [IntegerLiteral] 3
|
||||
# 6| 2: [ConstCase] case ...
|
||||
# 6| -1: [IntegerLiteral] 2
|
||||
# 6| 0: [StringLiteral] "d"
|
||||
# 7| 3: [DefaultCase] default
|
||||
# 7| -1: [IntegerLiteral] 3
|
||||
# 9| 1: [SwitchStmt] switch (...)
|
||||
# 9| -1: [VarAccess] s
|
||||
# 10| 0: [ConstCase] case ...
|
||||
# 10| -1: [BlockStmt] { ... }
|
||||
# 10| 0: [StringLiteral] "a"
|
||||
# 10| 1: [StringLiteral] "b"
|
||||
# 11| 1: [ConstCase] case ...
|
||||
# 11| -1: [BlockStmt] { ... }
|
||||
# 11| 0: [StringLiteral] "c"
|
||||
# 12| 2: [ConstCase] case ...
|
||||
# 12| -1: [BlockStmt] { ... }
|
||||
# 12| 0: [StringLiteral] "d"
|
||||
# 13| 3: [DefaultCase] default
|
||||
# 13| -1: [BlockStmt] { ... }
|
||||
|
||||
@@ -3,7 +3,14 @@ class Test {
|
||||
int x = switch(s) {
|
||||
case "a", "b" -> 1;
|
||||
case "c" -> 2;
|
||||
case "d" -> 2;
|
||||
default -> 3;
|
||||
};
|
||||
switch (s) {
|
||||
case "a", "b" -> { }
|
||||
case "c" -> { }
|
||||
case "d" -> { }
|
||||
default -> { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
| Test.java:5:7:5:17 | case ... | Test.java:3:20:3:20 | s | Test.java:5:12:5:14 | "c" | true | true | Test.java:5:7:5:17 | case ... |
|
||||
| Test.java:6:7:6:17 | case ... | Test.java:3:20:3:20 | s | Test.java:6:12:6:14 | "d" | true | true | Test.java:6:7:6:17 | case ... |
|
||||
|
||||
Reference in New Issue
Block a user