[FE] Make whens on expect sealed classes and enums not exhaustive

This commit is contained in:
Dmitriy Novozhilov
2021-02-24 16:44:48 +03:00
parent 1cf73203c7
commit 4222bb9af2
29 changed files with 768 additions and 11 deletions
@@ -17989,6 +17989,34 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/exhaustiveness")
@TestDataPath("$PROJECT_ROOT")
public class Exhaustiveness {
@Test
public void testAllFilesPresentInExhaustiveness() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/multiplatform/exhaustiveness"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@Test
@TestMetadata("expectEnum.kt")
public void testExpectEnum() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/exhaustiveness/expectEnum.kt");
}
@Test
@TestMetadata("expectSealedClass.kt")
public void testExpectSealedClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/exhaustiveness/expectSealedClass.kt");
}
@Test
@TestMetadata("expectSealedInterface.kt")
public void testExpectSealedInterface() throws Exception {
runTest("compiler/testData/diagnostics/tests/multiplatform/exhaustiveness/expectSealedInterface.kt");
}
}
@Nested
@TestMetadata("compiler/testData/diagnostics/tests/multiplatform/generic")
@TestDataPath("$PROJECT_ROOT")