[AA] Add tests for diagnostics suppression on top-level declarations in scripts
- `scriptUninitializedTopLevelProperty` is currently disabled in FIR because it fails with a mismatch between diagnostics from the file and the individual elements. It will be enabled in the next commit. ^KT-62899
This commit is contained in:
committed by
Space Team
parent
c9cb2062bd
commit
c482786bc4
+12
@@ -54,5 +54,17 @@ public class FirIdeNormalAnalysisScriptSourceModuleCollectDiagnosticsTestGenerat
|
|||||||
public void testAllFilesPresentInSuppression() throws Exception {
|
public void testAllFilesPresentInSuppression() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression"), Pattern.compile("^(.+)\\.kts$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("scriptUninitializedTopLevelProperty.kts")
|
||||||
|
public void testScriptUninitializedTopLevelProperty() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty.kts");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("scriptUninitializedTopLevelProperty2.kts")
|
||||||
|
public void testScriptUninitializedTopLevelProperty2() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/scriptUninitializedTopLevelProperty2.kts");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
|
|
||||||
|
@Suppress("MUST_BE_INITIALIZED")
|
||||||
|
val foo: Int
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtStringTemplateExpression at (1,11-32)
|
||||||
|
ERROR_SUPPRESSION text ranges: [(10,31)]
|
||||||
|
PSI: KtStringTemplateExpression at (1,11-32)
|
||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
// IGNORE_FIR
|
||||||
|
// In FIR, there is currently a mismatch between the file's diagnostics and the individual elements' diagnostics, so we have to disable the
|
||||||
|
// FIR test. It will be fixed by KT-63221.
|
||||||
|
|
||||||
|
@Suppress("MUST_BE_INITIALIZED")
|
||||||
|
val foo: Int
|
||||||
|
|
||||||
|
val bar: String
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
Diagnostics from elements:
|
||||||
|
for PSI element of type KtStringTemplateExpression at (1,11-32)
|
||||||
|
ERROR_SUPPRESSION text ranges: [(10,31)]
|
||||||
|
PSI: KtStringTemplateExpression at (1,11-32)
|
||||||
Reference in New Issue
Block a user