File tree Expand file tree Collapse file tree
org.jacoco.core.test.validation.java20/src/org/jacoco/core/test/validation/java20 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 *******************************************************************************/
1313package org .jacoco .core .test .validation .java20 ;
1414
15+ import org .jacoco .core .test .validation .JavaVersion ;
16+ import org .jacoco .core .test .validation .Source .Line ;
1517import org .jacoco .core .test .validation .ValidationTestBase ;
1618import org .jacoco .core .test .validation .java20 .targets .RecordPatternsTarget ;
1719
@@ -24,4 +26,22 @@ public RecordPatternsTest() {
2426 super (RecordPatternsTarget .class );
2527 }
2628
29+ public void assertSwitchStatementCase (Line line ) {
30+ if (JavaVersion .current ().isBefore ("21" )) {
31+ assertFullyCovered (line );
32+ } else {
33+ // https://github.com/openjdk/jdk/commit/138cdc9283ae8f3367e51f0fe7e27833118dd7cb
34+ assertPartlyCovered (line );
35+ }
36+ }
37+
38+ public void assertSwitchStatementDefault (Line line ) {
39+ if (JavaVersion .current ().isBefore ("21" )) {
40+ assertPartlyCovered (line );
41+ } else {
42+ // https://github.com/openjdk/jdk/commit/138cdc9283ae8f3367e51f0fe7e27833118dd7cb
43+ assertFullyCovered (line );
44+ }
45+ }
46+
2747}
Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ private static void instanceofOperator(Object o) {
3131
3232 private static void switchStatement (Object p ) {
3333 switch (p ) { // assertFullyCovered(0, 2)
34- case Point (int x , int y ) -> nop (x + y ); // assertFullyCovered ()
35- default -> nop (); // assertPartlyCovered ()
34+ case Point (int x , int y ) -> nop (x + y ); // assertSwitchStatementCase ()
35+ default -> nop (); // assertSwitchStatementDefault ()
3636 } // assertEmpty()
3737 }
3838
You can’t perform that action at this time.
0 commit comments