From dcb3fc550887078a4a36b44a485508673d445c2e Mon Sep 17 00:00:00 2001 From: Anastasiya Shadrina Date: Wed, 9 Jun 2021 15:26:53 +0700 Subject: [PATCH] [Tests] Add missing tests --- ...CompilerTestFE10TestdataTestGenerated.java | 103 +++++++ .../compiler/based/FirIdeSpecTest.java | 281 ++++++++++++++++-- ...DiagnosticsWithLightTreeTestGenerated.java | 118 ++++++++ 3 files changed, 485 insertions(+), 17 deletions(-) diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 26377c04699..5f5dc149627 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -10566,6 +10566,109 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag public void testVariableInvoke() throws Exception { runTest("compiler/testData/diagnostics/tests/extensions/variableInvoke.kt"); } + + @TestMetadata("compiler/testData/diagnostics/tests/extensions/contextReceivers") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ContextReceivers extends AbstractDiagnosisCompilerTestDataTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInContextReceivers() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/extensions/contextReceivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("dp.kt") + public void testDp() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/dp.kt"); + } + + @TestMetadata("genericOuterClass.kt") + public void testGenericOuterClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/genericOuterClass.kt"); + } + + @TestMetadata("insideDeclaration.kt") + public void testInsideDeclaration() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/insideDeclaration.kt"); + } + + @TestMetadata("lazy.kt") + public void testLazy() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lazy.kt"); + } + + @TestMetadata("manyReceivers.kt") + public void testManyReceivers() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/manyReceivers.kt"); + } + + @TestMetadata("noExplicitReceiver.kt") + public void testNoExplicitReceiver() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noExplicitReceiver.kt"); + } + + @TestMetadata("outerClass.kt") + public void testOuterClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt"); + } + + @TestMetadata("plusMatrix.kt") + public void testPlusMatrix() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/plusMatrix.kt"); + } + + @TestMetadata("superWithContext.kt") + public void testSuperWithContext() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/superWithContext.kt"); + } + + @TestMetadata("thisIdentifierInfo.kt") + public void testThisIdentifierInfo() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisIdentifierInfo.kt"); + } + + @TestMetadata("thisWithCustomLabel.kt") + public void testThisWithCustomLabel() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithCustomLabel.kt"); + } + + @TestMetadata("thisWithReceiverLabelsClasses.kt") + public void testThisWithReceiverLabelsClasses() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsClasses.kt"); + } + + @TestMetadata("thisWithReceiverLabelsFunctions.kt") + public void testThisWithReceiverLabelsFunctions() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsFunctions.kt"); + } + + @TestMetadata("thisWithReceiverLabelsProperties.kt") + public void testThisWithReceiverLabelsProperties() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsProperties.kt"); + } + + @TestMetadata("typeParameterized.kt") + public void testTypeParameterized() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterized.kt"); + } + + @TestMetadata("typeParameterizedList.kt") + public void testTypeParameterizedList() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterizedList.kt"); + } + + @TestMetadata("withExplicitReceiver.kt") + public void testWithExplicitReceiver() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiver.kt"); + } + + @TestMetadata("withExplicitReceiverError.kt") + public void testWithExplicitReceiverError() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiverError.kt"); + } + } } @Nested diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/FirIdeSpecTest.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/FirIdeSpecTest.java index 84c9b3a6608..10486adcb48 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/FirIdeSpecTest.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/FirIdeSpecTest.java @@ -21,7 +21,7 @@ import java.util.regex.Pattern; public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { @Test public void testAllFilesPresentInDiagnostics() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/classifier-declaration/data-class-declaration", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/declarations/type-alias", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked\\annotations", "linked\\built-in-types-and-their-semantics", "linked\\control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked\\control--and-data-flow-analysis\\performing-analysis-on-the-control-flow-graph", "linked\\declarations\\classifier-declaration\\class-declaration\\nested-and-inner-classifiers", "linked\\declarations\\classifier-declaration\\classifier-initialization", "linked\\declarations\\classifier-declaration\\data-class-declaration", "linked\\declarations\\function-declaration", "linked\\declarations\\property-declaration\\property-initialization", "linked\\declarations\\type-alias", "linked\\expressions\\call-and-property-access-expressions", "linked\\expressions\\function-literals", "linked\\inheritance", "linked\\overload-resolution\\c-level-partition", "linked\\overload-resolution\\determining-function-applicability-for-a-specific-call\\rationale", "linked\\overloadable-operators", "linked\\statements\\assignments\\simple-assignments", "linked\\type-inference\\local-type-inference", "linked\\type-inference\\smart-casts\\smart-cast-types", "linked\\type-system\\subtyping\\subtyping-for-nullable-types", "linked\\type-system\\type-kinds\\type-parameters"); } @Nested @@ -30,7 +30,72 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Linked { @Test public void testAllFilesPresentInLinked() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "declarations/classifier-declaration/classifier-initialization", "declarations/classifier-declaration/data-class-declaration", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "declarations/type-alias", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInAnnotations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotation_targets extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInAnnotation_targets() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/annotations/annotation-targets"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Built_in_types_and_their_semantics extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInBuilt_in_types_and_their_semantics() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Built_in_integer_types_1 extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInBuilt_in_integer_types_1() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Integer_type_widening extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInInteger_type_widening() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/built-in-types-and-their-semantics/built-in-integer-types-1/integer-type-widening"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } } @Nested @@ -39,7 +104,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Control__and_data_flow_analysis { @Test public void testAllFilesPresentInControl__and_data_flow_analysis() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "performing-analysis-on-the-control-flow-graph"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -149,6 +214,45 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Performing_analysis_on_the_control_flow_graph extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInPerforming_analysis_on_the_control_flow_graph() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Variable_initialization_analysis extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInVariable_initialization_analysis() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph/variable-initialization-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Control__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInControl__and_data_flow_analysis_control_flow_graph_expressions_1_conditional_expressions() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } } @Nested @@ -157,7 +261,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Declarations { @Test public void testAllFilesPresentInDeclarations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/class-declaration/nested-and-inner-classifiers", "classifier-declaration/classifier-initialization", "classifier-declaration/data-class-declaration", "function-declaration", "property-declaration/property-initialization", "type-alias"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -166,7 +270,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Classifier_declaration { @Test public void testAllFilesPresentInClassifier_declaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "class-declaration/nested-and-inner-classifiers", "classifier-initialization", "data-class-declaration"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -175,7 +279,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Class_declaration { @Test public void testAllFilesPresentInClass_declaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "nested-and-inner-classifiers"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -517,6 +621,58 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Nested_and_inner_classifiers extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInNested_and_inner_classifiers() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Classifier_initialization extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInClassifier_initialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/classifier-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Data_class_declaration extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInData_class_declaration() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/data-class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Function_declaration extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInFunction_declaration() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/function-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } @@ -526,7 +682,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Property_declaration { @Test public void testAllFilesPresentInProperty_declaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "property-initialization"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -564,6 +720,32 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Property_initialization extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInProperty_initialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/property-initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Type_alias extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInType_alias() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/type-alias"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } } } @@ -573,7 +755,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Expressions { @Test public void testAllFilesPresentInExpressions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "call-and-property-access-expressions", "function-literals"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -3179,7 +3361,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Overload_resolution { @Test public void testAllFilesPresentInOverload_resolution() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call/rationale"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -4632,7 +4814,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Determining_function_applicability_for_a_specific_call { @Test public void testAllFilesPresentInDetermining_function_applicability_for_a_specific_call() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "rationale"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -4670,6 +4852,19 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Rationale extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInRationale() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } } @Nested @@ -4947,7 +5142,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Statements { @Test public void testAllFilesPresentInStatements() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "assignments/simple-assignments"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -4956,7 +5151,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Assignments { @Test public void testAllFilesPresentInAssignments() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "simple-assignments"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -5068,6 +5263,19 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Simple_assignments extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInSimple_assignments() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/simple-assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } } @Nested @@ -5211,7 +5419,20 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Type_inference { @Test public void testAllFilesPresentInType_inference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "local-type-inference", "smart-casts/smart-cast-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Local_type_inference extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInLocal_type_inference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/local-type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } } @Nested @@ -5220,7 +5441,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Smart_casts { @Test public void testAllFilesPresentInSmart_casts() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "smart-cast-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -5274,6 +5495,19 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Smart_cast_types extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInSmart_cast_types() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } } } @@ -5283,7 +5517,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Type_system { @Test public void testAllFilesPresentInType_system() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping/subtyping-for-nullable-types", "type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -5372,7 +5606,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Subtyping { @Test public void testAllFilesPresentInSubtyping() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -5546,7 +5780,7 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { public class Type_kinds { @Test public void testAllFilesPresentInType_kinds() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } @Nested @@ -5658,6 +5892,19 @@ public class FirIdeSpecTest extends AbstractDiagnosisCompilerTestDataSpecTest { } } } + + @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Type_parameters extends AbstractDiagnosisCompilerTestDataSpecTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInType_parameters() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + } } } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index f16edb1818f..85161f18f4d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -10566,6 +10566,124 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac public void testVariableInvoke() throws Exception { runTest("compiler/testData/diagnostics/tests/extensions/variableInvoke.kt"); } + + @Nested + @TestMetadata("compiler/testData/diagnostics/tests/extensions/contextReceivers") + @TestDataPath("$PROJECT_ROOT") + public class ContextReceivers { + @Test + public void testAllFilesPresentInContextReceivers() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/extensions/contextReceivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + } + + @Test + @TestMetadata("dp.kt") + public void testDp() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/dp.kt"); + } + + @Test + @TestMetadata("genericOuterClass.kt") + public void testGenericOuterClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/genericOuterClass.kt"); + } + + @Test + @TestMetadata("insideDeclaration.kt") + public void testInsideDeclaration() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/insideDeclaration.kt"); + } + + @Test + @TestMetadata("lazy.kt") + public void testLazy() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/lazy.kt"); + } + + @Test + @TestMetadata("manyReceivers.kt") + public void testManyReceivers() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/manyReceivers.kt"); + } + + @Test + @TestMetadata("noExplicitReceiver.kt") + public void testNoExplicitReceiver() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/noExplicitReceiver.kt"); + } + + @Test + @TestMetadata("outerClass.kt") + public void testOuterClass() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/outerClass.kt"); + } + + @Test + @TestMetadata("plusMatrix.kt") + public void testPlusMatrix() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/plusMatrix.kt"); + } + + @Test + @TestMetadata("superWithContext.kt") + public void testSuperWithContext() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/superWithContext.kt"); + } + + @Test + @TestMetadata("thisIdentifierInfo.kt") + public void testThisIdentifierInfo() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisIdentifierInfo.kt"); + } + + @Test + @TestMetadata("thisWithCustomLabel.kt") + public void testThisWithCustomLabel() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithCustomLabel.kt"); + } + + @Test + @TestMetadata("thisWithReceiverLabelsClasses.kt") + public void testThisWithReceiverLabelsClasses() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsClasses.kt"); + } + + @Test + @TestMetadata("thisWithReceiverLabelsFunctions.kt") + public void testThisWithReceiverLabelsFunctions() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsFunctions.kt"); + } + + @Test + @TestMetadata("thisWithReceiverLabelsProperties.kt") + public void testThisWithReceiverLabelsProperties() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/thisWithReceiverLabelsProperties.kt"); + } + + @Test + @TestMetadata("typeParameterized.kt") + public void testTypeParameterized() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterized.kt"); + } + + @Test + @TestMetadata("typeParameterizedList.kt") + public void testTypeParameterizedList() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/typeParameterizedList.kt"); + } + + @Test + @TestMetadata("withExplicitReceiver.kt") + public void testWithExplicitReceiver() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiver.kt"); + } + + @Test + @TestMetadata("withExplicitReceiverError.kt") + public void testWithExplicitReceiverError() throws Exception { + runTest("compiler/testData/diagnostics/tests/extensions/contextReceivers/withExplicitReceiverError.kt"); + } + } } @Nested