[LL FIR] add lazy body calculation tests for scripts
After KT-65344 we can effectively calculate lazy bodies in scripts, so we can safely add the test ^KT-62840
This commit is contained in:
committed by
Space Team
parent
f77c08a821
commit
898c8c002e
+5
-11
@@ -12,6 +12,7 @@ import kotlinx.collections.immutable.toPersistentList
|
|||||||
import org.jetbrains.kotlin.KtFakeSourceElementKind
|
import org.jetbrains.kotlin.KtFakeSourceElementKind
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDesignation
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDesignation
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.withFirDesignationEntry
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.api.withFirDesignationEntry
|
||||||
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.util.forEachDeclaration
|
||||||
import org.jetbrains.kotlin.fir.*
|
import org.jetbrains.kotlin.fir.*
|
||||||
import org.jetbrains.kotlin.fir.builder.PsiRawFirBuilder
|
import org.jetbrains.kotlin.fir.builder.PsiRawFirBuilder
|
||||||
import org.jetbrains.kotlin.fir.contracts.FirRawContractDescription
|
import org.jetbrains.kotlin.fir.contracts.FirRawContractDescription
|
||||||
@@ -762,20 +763,13 @@ private abstract class FirLazyAnnotationTransformer : FirTransformer<FirLazyAnno
|
|||||||
}
|
}
|
||||||
|
|
||||||
private object FirAllLazyBodiesCalculatorTransformer : FirLazyBodiesCalculatorTransformer() {
|
private object FirAllLazyBodiesCalculatorTransformer : FirLazyBodiesCalculatorTransformer() {
|
||||||
override fun transformFile(file: FirFile, data: PersistentList<FirDeclaration>): FirFile {
|
|
||||||
file.declarations.forEach {
|
|
||||||
it.transformSingle(this, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
return file
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun <E : FirElement> transformElement(element: E, data: PersistentList<FirDeclaration>): E {
|
override fun <E : FirElement> transformElement(element: E, data: PersistentList<FirDeclaration>): E {
|
||||||
if (element is FirRegularClass) {
|
if (element is FirFile || element is FirScript || element is FirRegularClass) {
|
||||||
val newList = data.add(element)
|
val newList = data.add(element as FirDeclaration)
|
||||||
element.declarations.forEach {
|
element.forEachDeclaration {
|
||||||
it.transformSingle(this, newList)
|
it.transformSingle(this, newList)
|
||||||
}
|
}
|
||||||
|
|
||||||
element.transformChildren(this, newList)
|
element.transformChildren(this, newList)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-3
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.analysis.low.level.api.fir
|
|||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyBodiesCalculator
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.lazy.resolve.FirLazyBodiesCalculator
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirOutOfContentRootTestConfigurator
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirOutOfContentRootTestConfigurator
|
||||||
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirScriptTestConfigurator
|
||||||
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirSourceTestConfigurator
|
import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirSourceTestConfigurator
|
||||||
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
|
import org.jetbrains.kotlin.analysis.test.framework.base.AbstractAnalysisApiBasedTest
|
||||||
import org.jetbrains.kotlin.fir.FirElement
|
import org.jetbrains.kotlin.fir.FirElement
|
||||||
@@ -44,6 +45,7 @@ abstract class AbstractFirLazyBodiesCalculatorTest : AbstractAnalysisApiBasedTes
|
|||||||
|
|
||||||
FirLazyBodiesCalculator.calculateAllLazyExpressionsInFile(laziedFirFile)
|
FirLazyBodiesCalculator.calculateAllLazyExpressionsInFile(laziedFirFile)
|
||||||
laziedFirFile.accept(lazyChecker)
|
laziedFirFile.accept(lazyChecker)
|
||||||
|
val laziedFirFileDump = FirRenderer().renderElementAsString(laziedFirFile)
|
||||||
|
|
||||||
val fullFirFile = PsiRawFirBuilder(
|
val fullFirFile = PsiRawFirBuilder(
|
||||||
session,
|
session,
|
||||||
@@ -51,10 +53,9 @@ abstract class AbstractFirLazyBodiesCalculatorTest : AbstractAnalysisApiBasedTes
|
|||||||
bodyBuildingMode = BodyBuildingMode.NORMAL
|
bodyBuildingMode = BodyBuildingMode.NORMAL
|
||||||
).buildFirFile(mainFile)
|
).buildFirFile(mainFile)
|
||||||
|
|
||||||
val laziedFirFileDump = FirRenderer().renderElementAsString(laziedFirFile)
|
|
||||||
val fullFirFileDump = FirRenderer().renderElementAsString(fullFirFile)
|
val fullFirFileDump = FirRenderer().renderElementAsString(fullFirFile)
|
||||||
|
|
||||||
TestCase.assertEquals(laziedFirFileDump, fullFirFileDump)
|
TestCase.assertEquals(/* expected = */ fullFirFileDump, /* actual = */ laziedFirFileDump)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,4 +66,8 @@ abstract class AbstractFirSourceLazyBodiesCalculatorTest : AbstractFirLazyBodies
|
|||||||
|
|
||||||
abstract class AbstractFirOutOfContentRootLazyBodiesCalculatorTest : AbstractFirLazyBodiesCalculatorTest() {
|
abstract class AbstractFirOutOfContentRootLazyBodiesCalculatorTest : AbstractFirLazyBodiesCalculatorTest() {
|
||||||
override val configurator = AnalysisApiFirOutOfContentRootTestConfigurator
|
override val configurator = AnalysisApiFirOutOfContentRootTestConfigurator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
abstract class AbstractFirScriptLazyBodiesCalculatorTest : AbstractFirLazyBodiesCalculatorTest() {
|
||||||
|
override val configurator = AnalysisApiFirScriptTestConfigurator(analyseInDependentSession = false)
|
||||||
|
}
|
||||||
|
|||||||
+7
-7
@@ -21,7 +21,7 @@ import java.util.regex.Pattern;
|
|||||||
public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends AbstractFirOutOfContentRootLazyBodiesCalculatorTest {
|
public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends AbstractFirOutOfContentRootLazyBodiesCalculatorTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInRawBuilder() throws Exception {
|
public void testAllFilesPresentInRawBuilder() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@@ -30,7 +30,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class Declarations {
|
public class Declarations {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInDeclarations() throws Exception {
|
public void testAllFilesPresentInDeclarations() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -465,7 +465,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class Contracts {
|
public class Contracts {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInContracts() throws Exception {
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@@ -474,7 +474,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class NewSyntax {
|
public class NewSyntax {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNewSyntax() throws Exception {
|
public void testAllFilesPresentInNewSyntax() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -502,7 +502,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class OldSyntax {
|
public class OldSyntax {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInOldSyntax() throws Exception {
|
public void testAllFilesPresentInOldSyntax() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -519,7 +519,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class NoParameterType {
|
public class NoParameterType {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNoParameterType() throws Exception {
|
public void testAllFilesPresentInNoParameterType() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -602,7 +602,7 @@ public class FirOutOfContentRootLazyBodiesCalculatorTestGenerated extends Abstra
|
|||||||
public class Expressions {
|
public class Expressions {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInExpressions() throws Exception {
|
public void testAllFilesPresentInExpressions() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+110
@@ -0,0 +1,110 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2024 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.analysis.low.level.api.fir;
|
||||||
|
|
||||||
|
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 org.jetbrains.kotlin.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class FirScriptLazyBodiesCalculatorTestGenerated extends AbstractFirScriptLazyBodiesCalculatorTest {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInRawBuilder() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Declarations {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInDeclarations() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("script.kts")
|
||||||
|
public void testScript() throws Exception {
|
||||||
|
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/script.kts");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("scriptLevelDestructuringWithAnnotation.kts")
|
||||||
|
public void testScriptLevelDestructuringWithAnnotation() throws Exception {
|
||||||
|
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptLevelDestructuringWithAnnotation.kts");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("scriptStatementLevelDestructuringWithAnnotation.kts")
|
||||||
|
public void testScriptStatementLevelDestructuringWithAnnotation() throws Exception {
|
||||||
|
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotation.kts");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts")
|
||||||
|
public void testScriptStatementLevelDestructuringWithAnnotationAsLastStatement() throws Exception {
|
||||||
|
runTest("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/scriptStatementLevelDestructuringWithAnnotationAsLastStatement.kts");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Contracts {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NewSyntax {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNewSyntax() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class OldSyntax {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInOldSyntax() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class NoParameterType {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInNoParameterType() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nested
|
||||||
|
@TestMetadata("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
public class Expressions {
|
||||||
|
@Test
|
||||||
|
public void testAllFilesPresentInExpressions() throws Exception {
|
||||||
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions"), Pattern.compile("^(.+)\\.(kts)$"), null, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-7
@@ -21,7 +21,7 @@ import java.util.regex.Pattern;
|
|||||||
public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourceLazyBodiesCalculatorTest {
|
public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourceLazyBodiesCalculatorTest {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInRawBuilder() throws Exception {
|
public void testAllFilesPresentInRawBuilder() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@@ -30,7 +30,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class Declarations {
|
public class Declarations {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInDeclarations() throws Exception {
|
public void testAllFilesPresentInDeclarations() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -465,7 +465,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class Contracts {
|
public class Contracts {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInContracts() throws Exception {
|
public void testAllFilesPresentInContracts() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nested
|
@Nested
|
||||||
@@ -474,7 +474,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class NewSyntax {
|
public class NewSyntax {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNewSyntax() throws Exception {
|
public void testAllFilesPresentInNewSyntax() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/newSyntax"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -502,7 +502,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class OldSyntax {
|
public class OldSyntax {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInOldSyntax() throws Exception {
|
public void testAllFilesPresentInOldSyntax() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/contracts/oldSyntax"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -519,7 +519,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class NoParameterType {
|
public class NoParameterType {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInNoParameterType() throws Exception {
|
public void testAllFilesPresentInNoParameterType() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/declarations/noParameterType"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -602,7 +602,7 @@ public class FirSourceLazyBodiesCalculatorTestGenerated extends AbstractFirSourc
|
|||||||
public class Expressions {
|
public class Expressions {
|
||||||
@Test
|
@Test
|
||||||
public void testAllFilesPresentInExpressions() throws Exception {
|
public void testAllFilesPresentInExpressions() throws Exception {
|
||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/raw-fir/psi2fir/testData/rawBuilder/expressions"), Pattern.compile("^(.+)\\.(kt)$"), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+7
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
* Copyright 2010-2024 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.
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -36,11 +36,15 @@ import org.jetbrains.kotlin.test.utils.CUSTOM_TEST_DATA_EXTENSION_PATTERN
|
|||||||
internal fun TestGroupSuite.generateFirLowLevelApiTests() {
|
internal fun TestGroupSuite.generateFirLowLevelApiTests() {
|
||||||
testGroup("analysis/low-level-api-fir/tests", "compiler/fir/raw-fir/psi2fir/testData") {
|
testGroup("analysis/low-level-api-fir/tests", "compiler/fir/raw-fir/psi2fir/testData") {
|
||||||
testClass<AbstractFirSourceLazyBodiesCalculatorTest> {
|
testClass<AbstractFirSourceLazyBodiesCalculatorTest> {
|
||||||
model("rawBuilder", testMethod = "doTest")
|
model("rawBuilder", pattern = TestGeneratorUtil.KT)
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass<AbstractFirOutOfContentRootLazyBodiesCalculatorTest> {
|
testClass<AbstractFirOutOfContentRootLazyBodiesCalculatorTest> {
|
||||||
model("rawBuilder", testMethod = "doTest")
|
model("rawBuilder", pattern = TestGeneratorUtil.KT)
|
||||||
|
}
|
||||||
|
|
||||||
|
testClass<AbstractFirScriptLazyBodiesCalculatorTest> {
|
||||||
|
model("rawBuilder", pattern = TestGeneratorUtil.KTS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user