Skip to content

Commit

Permalink
Adjust validation test in accordance with changes for JEP 455 in JDK …
Browse files Browse the repository at this point in the history
…23 (#1580)
  • Loading branch information
Godin committed Feb 19, 2024
1 parent 8067986 commit 25594b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -26,12 +26,24 @@ public RecordPatternsTest() {
super(RecordPatternsTarget.class);
}

public void assertSwitchStatementLastCase(final Line line) {
if (isJDKCompiler) {
assertFullyCovered(line);
public void assertInstanceof(final Line line) {
if (JavaVersion.current().isBefore("23")) {
assertFullyCovered(line, 0, 2);
} else {
// TODO https://bugs.openjdk.org/browse/JDK-8303374
assertFullyCovered(line, 2, 4);
}
}

public void assertSwitchStatementLastCase(final Line line) {
if (!isJDKCompiler) {
// https://github.com/eclipse-jdt/eclipse.jdt.core/issues/773
assertPartlyCovered(line);
} else if (JavaVersion.current().isBefore("23")) {
assertFullyCovered(line);
} else {
// TODO https://bugs.openjdk.org/browse/JDK-8303374
assertPartlyCovered(line, 2, 2);
}
}

Expand Down
Expand Up @@ -24,7 +24,7 @@ private record Point(int x, int y) {
}

private static void instanceofOperator(Object o) {
if (o instanceof Point(int x, int y)) { // assertFullyCovered(0, 2)
if (o instanceof Point(int x, int y)) { // assertInstanceof()
nop(x + y); // assertFullyCovered()
} // assertEmpty()
}
Expand Down

0 comments on commit 25594b2

Please sign in to comment.