From dbba9297ff13770062b298e4f6f59191fa4d1c3d Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Mon, 21 Jun 2021 17:02:12 +0200 Subject: [PATCH] FIR IDE: restore InnerDeclarationsResolvePhaseTest --- .../tests/frontend/api/GenerateTests.kt | 5 + .../innerDeclarationsResolve/class.fir.txt | 4 +- ...DeclarationsResolvePhaseTestGenerated.java | 104 ++++++++++++++++++ 3 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/resolve/InnerDeclarationsResolvePhaseTestGenerated.java diff --git a/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt b/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt index 62f89d7498e..f01d03dc4d4 100644 --- a/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt +++ b/generators/frontend-api-generator/tests/org/jetbrains/kotlin/generators/tests/frontend/api/GenerateTests.kt @@ -25,6 +25,7 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.diagnostic.AbstractFirContext import org.jetbrains.kotlin.idea.fir.low.level.api.diagnostic.compiler.based.AbstractDiagnosisCompilerTestDataSpecTest import org.jetbrains.kotlin.idea.fir.low.level.api.diagnostic.compiler.based.AbstractDiagnosisCompilerTestDataTest import org.jetbrains.kotlin.idea.fir.low.level.api.file.structure.AbstractFileStructureTest +import org.jetbrains.kotlin.idea.fir.low.level.api.resolve.AbstractInnerDeclarationsResolvePhaseTest import org.jetbrains.kotlin.spec.utils.GeneralConfiguration import org.jetbrains.kotlin.spec.utils.tasks.detectDirsWithTestsMapFileOnly import org.jetbrains.kotlin.test.generators.generateTestGroupSuiteWithJUnit5 @@ -107,6 +108,10 @@ fun main(args: Array) { model("diagnosticTraversalCounter") } + testClass { + model("innerDeclarationsResolve") + } + testClass { model("partialRawBuilder", testMethod = "doRawFirTest") } diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/class.fir.txt b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/class.fir.txt index 6a19219776f..eb29570ce41 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/class.fir.txt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/class.fir.txt @@ -10,8 +10,8 @@ FILE: class.kt private final [BODY_RESOLVE] val y: = this@R|/B|.R|/B.q|() [BODY_RESOLVE] private get(): - public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] a: ): { - ^foo #(R|/a|, = [BODY_RESOLVE] with@fun (): { + public final [BODY_RESOLVE] fun foo([BODY_RESOLVE] a: ): { + ^foo #(R|/a|, = [BODY_RESOLVE] with@fun .(): { ^ #(String(a), this@R|/B|.R|/B.y|) } ) diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/resolve/InnerDeclarationsResolvePhaseTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/resolve/InnerDeclarationsResolvePhaseTestGenerated.java new file mode 100644 index 00000000000..6ebf01957ff --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/resolve/InnerDeclarationsResolvePhaseTestGenerated.java @@ -0,0 +1,104 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.resolve; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve") +@TestDataPath("$PROJECT_ROOT") +public class InnerDeclarationsResolvePhaseTestGenerated extends AbstractInnerDeclarationsResolvePhaseTest { + @Test + public void testAllFilesPresentInInnerDeclarationsResolve() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annonymousClass.kt") + public void testAnnonymousClass() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/annonymousClass.kt"); + } + + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/class.kt"); + } + + @Test + @TestMetadata("constructorParameter.kt") + public void testConstructorParameter() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/constructorParameter.kt"); + } + + @Test + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/enum.kt"); + } + + @Test + @TestMetadata("funWithoutTypes.kt") + public void testFunWithoutTypes() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/funWithoutTypes.kt"); + } + + @Test + @TestMetadata("functionValueParameter.kt") + public void testFunctionValueParameter() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/functionValueParameter.kt"); + } + + @Test + @TestMetadata("functionWithImplicitType.kt") + public void testFunctionWithImplicitType() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/functionWithImplicitType.kt"); + } + + @Test + @TestMetadata("lambdaInImplicitFunBody.kt") + public void testLambdaInImplicitFunBody() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/lambdaInImplicitFunBody.kt"); + } + + @Test + @TestMetadata("lambdaInImplicitPropertyBody.kt") + public void testLambdaInImplicitPropertyBody() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/lambdaInImplicitPropertyBody.kt"); + } + + @Test + @TestMetadata("lambdasInWithBodyFunction.kt") + public void testLambdasInWithBodyFunction() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/lambdasInWithBodyFunction.kt"); + } + + @Test + @TestMetadata("localClass.kt") + public void testLocalClass() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/localClass.kt"); + } + + @Test + @TestMetadata("propertyWithGetterAndSetter.kt") + public void testPropertyWithGetterAndSetter() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/propertyWithGetterAndSetter.kt"); + } + + @Test + @TestMetadata("propertyWithSetter.kt") + public void testPropertyWithSetter() throws Exception { + runTest("idea/idea-frontend-fir/idea-fir-low-level-api/testdata/innerDeclarationsResolve/propertyWithSetter.kt"); + } +}