[AA] Add diagnostics tests for sealed classes/interfaces
- KT-62895 cannot be reproduced on the Analysis API side. Still, it is useful to add tests here for better coverage in the future. - The reason is likely that Analysis API tests specifically use `SealedClassesInheritorsCaclulatorPreAnalysisHandler` to compute sealed class inheritors (which are usually the breaking point for problems in `when` exhaustiveness checking), so the tests do not use the production implementation. See KT-64505 for future work on this problem. ^KT-62895
This commit is contained in:
committed by
Space Team
parent
51f1e31cce
commit
eabbe21b66
+82
@@ -253,4 +253,86 @@ public class Fe10IdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ex
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedClassFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedClassFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedClassFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedClassFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleExhaustive.kt")
|
||||||
|
public void testSealedClassSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleMissingCase.kt")
|
||||||
|
public void testSealedClassSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleExhaustive.kt")
|
||||||
|
public void testSealedInterfaceSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleMissingCase.kt")
|
||||||
|
public void testSealedInterfaceSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -67,4 +67,14 @@ public class FirIdeNormalAnalysisScriptSourceModuleCollectDiagnosticsTestGenerat
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty2.kts");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty2.kts");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
@@ -67,4 +67,14 @@ public class FirIdeNormalAnalysisScriptSourceModuleDanglingFileCollectDiagnostic
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty2.kts");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty2.kts");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+82
@@ -253,4 +253,86 @@ public class FirIdeNormalAnalysisSourceModuleCollectDiagnosticsTestGenerated ext
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedClassFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedClassFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedClassFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedClassFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleExhaustive.kt")
|
||||||
|
public void testSealedClassSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleMissingCase.kt")
|
||||||
|
public void testSealedClassSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleExhaustive.kt")
|
||||||
|
public void testSealedInterfaceSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleMissingCase.kt")
|
||||||
|
public void testSealedInterfaceSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+82
@@ -253,4 +253,86 @@ public class FirIdeNormalAnalysisSourceModuleDanglingFileCollectDiagnosticsTestG
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedClassFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedClassFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedClassFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedClassFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleExhaustive.kt")
|
||||||
|
public void testSealedClassSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleMissingCase.kt")
|
||||||
|
public void testSealedClassSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleExhaustive.kt")
|
||||||
|
public void testSealedInterfaceSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleMissingCase.kt")
|
||||||
|
public void testSealedInterfaceSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+82
@@ -253,4 +253,86 @@ public class FirStandaloneNormalAnalysisSourceModuleCollectDiagnosticsTestGenera
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedClassFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedClassFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedClassFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedClassFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleExhaustive.kt")
|
||||||
|
public void testSealedClassSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleMissingCase.kt")
|
||||||
|
public void testSealedClassSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleExhaustive.kt")
|
||||||
|
public void testSealedInterfaceSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleMissingCase.kt")
|
||||||
|
public void testSealedInterfaceSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+82
@@ -253,4 +253,86 @@ public class FirStandaloneNormalAnalysisSourceModuleDanglingFileCollectDiagnosti
|
|||||||
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class When {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInWhen() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedClassFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedClassFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedClassFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedClassFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleExhaustive.kt")
|
||||||
|
public void testSealedClassSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedClassSameModuleMissingCase.kt")
|
||||||
|
public void testSealedClassSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedClassSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromDependencyMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromDependencyMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromDependencyMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryExhaustive.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceFromLibraryMissingCase.kt")
|
||||||
|
public void testSealedInterfaceFromLibraryMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceFromLibraryMissingCase.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleExhaustive.kt")
|
||||||
|
public void testSealedInterfaceSameModuleExhaustive() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleExhaustive.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("sealedInterfaceSameModuleMissingCase.kt")
|
||||||
|
public void testSealedInterfaceSameModuleMissingCase() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/when/sealedInterfaceSameModuleMissingCase.kt");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
// KT-64503
|
||||||
|
|
||||||
|
// MODULE: dependency
|
||||||
|
// FILE: MySealedClass.kt
|
||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
// MODULE: main(dependency)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
// KT-64503
|
||||||
|
|
||||||
|
// MODULE: dependency
|
||||||
|
// FILE: MySealedClass.kt
|
||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
// MODULE: main(dependency)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (14,12) - (16,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(109,113)]
|
||||||
|
PSI: KtWhenExpression at (14,12) - (16,6)
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
|
||||||
|
// MODULE: lib
|
||||||
|
// MODULE_KIND: LibraryBinary
|
||||||
|
// FILE: MySealedClass.kt
|
||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
|
||||||
|
// MODULE: lib
|
||||||
|
// MODULE_KIND: LibraryBinary
|
||||||
|
// FILE: MySealedClass.kt
|
||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (14,12) - (16,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(102,106)]
|
||||||
|
PSI: KtWhenExpression at (14,12) - (16,6)
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
sealed class MySealedClass
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedClass()
|
||||||
|
class TwoSealedChild : MySealedClass()
|
||||||
|
|
||||||
|
fun testSealed(m: MySealedClass): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (7,12) - (9,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(161,165)]
|
||||||
|
PSI: KtWhenExpression at (7,12) - (9,6)
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
// KT-64503
|
||||||
|
|
||||||
|
// MODULE: dependency
|
||||||
|
// FILE: MySealedInterface.kt
|
||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
// MODULE: main(dependency)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
// KT-64503
|
||||||
|
|
||||||
|
// MODULE: dependency
|
||||||
|
// FILE: MySealedInterface.kt
|
||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
// MODULE: main(dependency)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (14,12) - (16,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(113,117)]
|
||||||
|
PSI: KtWhenExpression at (14,12) - (16,6)
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
|
||||||
|
// MODULE: lib
|
||||||
|
// MODULE_KIND: LibraryBinary
|
||||||
|
// FILE: MySealedInterface.kt
|
||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// IGNORE_FE10
|
||||||
|
|
||||||
|
// MODULE: lib
|
||||||
|
// MODULE_KIND: LibraryBinary
|
||||||
|
// FILE: MySealedInterface.kt
|
||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
// MODULE: main(lib)
|
||||||
|
// FILE: main.kt
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (14,12) - (16,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(106,110)]
|
||||||
|
PSI: KtWhenExpression at (14,12) - (16,6)
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
is TwoSealedChild -> "2"
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
sealed interface MySealedInterface
|
||||||
|
|
||||||
|
class OneSealedChild : MySealedInterface
|
||||||
|
class TwoSealedChild : MySealedInterface
|
||||||
|
|
||||||
|
fun testSealed(m: MySealedInterface): String {
|
||||||
|
return when (m) {
|
||||||
|
is OneSealedChild -> "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtWhenExpression at (7,12) - (9,6)
|
||||||
|
NO_ELSE_IN_WHEN text ranges: [(177,181)]
|
||||||
|
PSI: KtWhenExpression at (7,12) - (9,6)
|
||||||
Reference in New Issue
Block a user