K2 Scripting tests: adding tests on script decls visibility

fixes (makes it stable) behavior of the script top-level declarations
visibility in K2 scripts
This commit is contained in:
Ilya Chernikov
2023-12-21 17:28:52 +01:00
committed by Space Team
parent e5a6900458
commit cdf4b17052
14 changed files with 311 additions and 93 deletions
@@ -34176,6 +34176,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/tests/script/resolveInitializerOfDestructuringDeclarationOnce.kts");
}
@Test
@TestMetadata("scriptDeclsShouldVisibleLocally.kts")
public void testScriptDeclsShouldVisibleLocally() {
runTest("compiler/testData/diagnostics/tests/script/scriptDeclsShouldVisibleLocally.kts");
}
@Test
@TestMetadata("scriptScopes.kts")
public void testScriptScopes() {
@@ -4472,6 +4472,16 @@ public class DiagnosticCompilerTestFirTestdataTestGenerated extends AbstractDiag
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/scripts")
@TestDataPath("$PROJECT_ROOT")
public class Scripts {
@Test
public void testAllFilesPresentInScripts() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/scripts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts")
@TestDataPath("$PROJECT_ROOT")
@@ -34176,6 +34176,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/tests/script/resolveInitializerOfDestructuringDeclarationOnce.kts");
}
@Test
@TestMetadata("scriptDeclsShouldVisibleLocally.kts")
public void testScriptDeclsShouldVisibleLocally() {
runTest("compiler/testData/diagnostics/tests/script/scriptDeclsShouldVisibleLocally.kts");
}
@Test
@TestMetadata("scriptScopes.kts")
public void testScriptScopes() {
@@ -4472,6 +4472,16 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFirTestDataTestGenerated
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/scripts")
@TestDataPath("$PROJECT_ROOT")
public class Scripts {
@Test
public void testAllFilesPresentInScripts() {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/scripts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
}
@Nested
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts")
@TestDataPath("$PROJECT_ROOT")