[Analysis API] Add tests for dangling files

This commit is contained in:
Yan Zhulanow
2023-11-13 16:33:08 +09:00
committed by Space Team
parent 2899822102
commit 9c91158be6
25 changed files with 2406 additions and 9 deletions
@@ -0,0 +1,70 @@
/*
* 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.api.fir.test.cases.generated.cases.components.diagnosticProvider;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractDanglingFileCollectDiagnosticsTest;
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("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeNormalAnalysisScriptSourceModuleDanglingFileCollectDiagnosticsTestGenerated extends AbstractDanglingFileCollectDiagnosticsTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.ScriptSource,
AnalysisSessionMode.Normal,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInDiagnostics() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics"), Pattern.compile("^(.+)\\.kts$"), null, true);
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression")
@TestDataPath("$PROJECT_ROOT")
public class Suppression {
@Test
public void testAllFilesPresentInSuppression() throws Exception {
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");
}
}
}
@@ -0,0 +1,256 @@
/*
* 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.api.fir.test.cases.generated.cases.components.diagnosticProvider;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractDanglingFileCollectDiagnosticsTest;
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("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeNormalAnalysisSourceModuleDanglingFileCollectDiagnosticsTestGenerated extends AbstractDanglingFileCollectDiagnosticsTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInDiagnostics() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("annotationWithEnumFromDuplicatedLibrary.kt")
public void testAnnotationWithEnumFromDuplicatedLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/annotationWithEnumFromDuplicatedLibrary.kt");
}
@Test
@TestMetadata("declarationErrors.kt")
public void testDeclarationErrors() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/declarationErrors.kt");
}
@Test
@TestMetadata("delegationToLibraryInterface.kt")
public void testDelegationToLibraryInterface() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/delegationToLibraryInterface.kt");
}
@Test
@TestMetadata("duplicatedCallableWithImplicitType.kt")
public void testDuplicatedCallableWithImplicitType() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/duplicatedCallableWithImplicitType.kt");
}
@Test
@TestMetadata("errorsInFunctionalInterfacesInstances.kt")
public void testErrorsInFunctionalInterfacesInstances() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/errorsInFunctionalInterfacesInstances.kt");
}
@Test
@TestMetadata("incompleteDelegation.kt")
public void testIncompleteDelegation() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteDelegation.kt");
}
@Test
@TestMetadata("incompleteFor.kt")
public void testIncompleteFor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
}
@Test
@TestMetadata("inferTypeFromGetValueDelegate.kt")
public void testInferTypeFromGetValueDelegate() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegate.kt");
}
@Test
@TestMetadata("inferTypeFromGetValueDelegateLibrary.kt")
public void testInferTypeFromGetValueDelegateLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegateLibrary.kt");
}
@Test
@TestMetadata("javaInnerClass.kt")
public void testJavaInnerClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClass.kt");
}
@Test
@TestMetadata("javaInnerClassFromAnotherModule.kt")
public void testJavaInnerClassFromAnotherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClassFromAnotherModule.kt");
}
@Test
@TestMetadata("javaInnerClassFromLibrary.kt")
public void testJavaInnerClassFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClassFromLibrary.kt");
}
@Test
@TestMetadata("javaNestedClass.kt")
public void testJavaNestedClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClass.kt");
}
@Test
@TestMetadata("javaNestedClassFromAnotherModule.kt")
public void testJavaNestedClassFromAnotherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClassFromAnotherModule.kt");
}
@Test
@TestMetadata("javaNestedClassFromLibrary.kt")
public void testJavaNestedClassFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClassFromLibrary.kt");
}
@Test
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/overrideProtectedClassReturnFromLibrary.kt");
}
@Test
@TestMetadata("resolutionErrors.kt")
public void testResolutionErrors() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/resolutionErrors.kt");
}
@Test
@TestMetadata("typeMismatches.kt")
public void testTypeMismatches() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/typeMismatches.kt");
}
@Test
@TestMetadata("unresolved.kt")
public void testUnresolved() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolved.kt");
}
@Test
@TestMetadata("unresolvedAnnotationsOnPropertyFromParameter.kt")
public void testUnresolvedAnnotationsOnPropertyFromParameter() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedAnnotationsOnPropertyFromParameter.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCall.kt")
public void testUnresolvedReferenceInsideSuperConstructorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCall.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithLocalFunction.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithLocalFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithLocalFunction.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction.kt")
public void testUnresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction.kt");
}
@Test
@TestMetadata("unresolvedSuperConstructorCall.kt")
public void testUnresolvedSuperConstructorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedSuperConstructorCall.kt");
}
@Test
@TestMetadata("unusedDestructuring.kt")
public void testUnusedDestructuring() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unusedDestructuring.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression")
@TestDataPath("$PROJECT_ROOT")
public class Suppression {
@Test
public void testAllFilesPresentInSuppression() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevel.kt")
public void testConflictingOverloadsAtTopLevel() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevel.kt");
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevel2.kt")
public void testConflictingOverloadsAtTopLevel2() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevel2.kt");
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevelWithFileSuppression.kt")
public void testConflictingOverloadsAtTopLevelWithFileSuppression() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevelWithFileSuppression.kt");
}
@Test
@TestMetadata("conflictingOverloadsInClass.kt")
public void testConflictingOverloadsInClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsInClass.kt");
}
@Test
@TestMetadata("conflictingOverloadsInNestedClass.kt")
public void testConflictingOverloadsInNestedClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsInNestedClass.kt");
}
@Test
@TestMetadata("deprecationAtTopLevel.kt")
public void testDeprecationAtTopLevel() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
}
}
}
@@ -0,0 +1,72 @@
/*
* 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.api.fir.test.cases.generated.cases.references;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.references.AbstractDanglingFileReferenceResolveTest;
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("analysis/analysis-api/testData/danglingFileReferenceResolve")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeDependentAnalysisSourceModuleDanglingFileReferenceResolveTestGenerated extends AbstractDanglingFileReferenceResolveTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Dependent,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInDanglingFileReferenceResolve() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/danglingFileReferenceResolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("classDifferentFile.kt")
public void testClassDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classDifferentFile.kt");
}
@Test
@TestMetadata("classSameFile.kt")
public void testClassSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classSameFile.kt");
}
@Test
@TestMetadata("functionDifferentFile.kt")
public void testFunctionDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionDifferentFile.kt");
}
@Test
@TestMetadata("functionSameFile.kt")
public void testFunctionSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionSameFile.kt");
}
}
@@ -0,0 +1,72 @@
/*
* 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.api.fir.test.cases.generated.cases.references;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.references.AbstractDanglingFileReferenceResolveTest;
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("analysis/analysis-api/testData/danglingFileReferenceResolve")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeNormalAnalysisLibrarySourceModuleDanglingFileReferenceResolveTestGenerated extends AbstractDanglingFileReferenceResolveTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.LibrarySource,
AnalysisSessionMode.Normal,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInDanglingFileReferenceResolve() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/danglingFileReferenceResolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("classDifferentFile.kt")
public void testClassDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classDifferentFile.kt");
}
@Test
@TestMetadata("classSameFile.kt")
public void testClassSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classSameFile.kt");
}
@Test
@TestMetadata("functionDifferentFile.kt")
public void testFunctionDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionDifferentFile.kt");
}
@Test
@TestMetadata("functionSameFile.kt")
public void testFunctionSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionSameFile.kt");
}
}
@@ -0,0 +1,72 @@
/*
* 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.api.fir.test.cases.generated.cases.references;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.fir.test.configurators.AnalysisApiFirTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.references.AbstractDanglingFileReferenceResolveTest;
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("analysis/analysis-api/testData/danglingFileReferenceResolve")
@TestDataPath("$PROJECT_ROOT")
public class FirIdeNormalAnalysisSourceModuleDanglingFileReferenceResolveTestGenerated extends AbstractDanglingFileReferenceResolveTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Ide
)
);
}
@Test
public void testAllFilesPresentInDanglingFileReferenceResolve() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/danglingFileReferenceResolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("classDifferentFile.kt")
public void testClassDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classDifferentFile.kt");
}
@Test
@TestMetadata("classSameFile.kt")
public void testClassSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classSameFile.kt");
}
@Test
@TestMetadata("functionDifferentFile.kt")
public void testFunctionDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionDifferentFile.kt");
}
@Test
@TestMetadata("functionSameFile.kt")
public void testFunctionSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionSameFile.kt");
}
}
@@ -0,0 +1,20 @@
/*
* Copyright 2010-2023 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.api.impl.base.test.cases.components.diagnosticProvider
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.test.model.TestModule
import org.jetbrains.kotlin.test.services.TestServices
abstract class AbstractDanglingFileCollectDiagnosticsTest : AbstractCollectDiagnosticsTest() {
override fun doTestByFileStructure(ktFile: KtFile, module: TestModule, testServices: TestServices) {
val ktPsiFactory = KtPsiFactory.contextual(ktFile, markGenerated = true, eventSystemEnabled = false)
val fakeKtFile = ktPsiFactory.createFile("fake.kt", ktFile.text)
super.doTestByFileStructure(fakeKtFile, module, testServices)
}
}
@@ -0,0 +1,34 @@
/*
* Copyright 2010-2023 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.api.impl.base.test.cases.references
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.analysis.api.symbols.KtSymbol
import org.jetbrains.kotlin.analysis.test.framework.project.structure.ktModuleProvider
import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.test.services.TestModuleStructure
import org.jetbrains.kotlin.test.services.TestServices
abstract class AbstractDanglingFileReferenceResolveTest : AbstractReferenceResolveTest() {
override fun KtAnalysisSession.getAdditionalSymbolInfo(symbol: KtSymbol): String? {
val containingFile = symbol.psi?.containingFile ?: return null
return containingFile.name
}
override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
val mainModule = findMainModule(moduleStructure)
val ktFiles = testServices.ktModuleProvider.getModuleFiles(mainModule).filterIsInstance<KtFile>()
val mainKtFile = findMainFile(ktFiles)
val caretPosition = testServices.expressionMarkerProvider.getCaretPosition(mainKtFile)
val ktPsiFactory = KtPsiFactory.contextual(mainKtFile, markGenerated = true, eventSystemEnabled = true)
val fakeKtFile = ktPsiFactory.createFile("fake.kt", mainKtFile.text)
doTestByFileStructure(fakeKtFile, caretPosition, mainModule, testServices)
}
}
@@ -46,19 +46,30 @@ abstract class AbstractReferenceResolveTest : AbstractAnalysisApiBasedTest() {
}
}
final override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
val mainModule = moduleStructure.modules.singleOrNull() ?: findMainModule(moduleStructure)
override fun doTestByModuleStructure(moduleStructure: TestModuleStructure, testServices: TestServices) {
val mainModule = findMainModule(moduleStructure)
val ktFiles = testServices.ktModuleProvider.getModuleFiles(mainModule).filterIsInstance<KtFile>()
doTestByFileStructure(ktFiles, mainModule, testServices)
val mainKtFile = findMainFile(ktFiles)
val caretPosition = testServices.expressionMarkerProvider.getCaretPosition(mainKtFile)
doTestByFileStructure(mainKtFile, caretPosition, mainModule, testServices)
}
private fun findMainModule(moduleStructure: TestModuleStructure): TestModule =
moduleStructure.modules.find { it.name == "main" } ?: error("There should be a module named 'main' in the multi-module test.")
protected fun findMainModule(moduleStructure: TestModuleStructure): TestModule {
val modules = moduleStructure.modules
fun doTestByFileStructure(ktFiles: List<KtFile>, mainModule: TestModule, testServices: TestServices) {
val mainKtFile = ktFiles.singleOrNull() ?: ktFiles.firstOrNull { it.name == "main.kt" } ?: ktFiles.first()
val caretPosition = testServices.expressionMarkerProvider.getCaretPosition(mainKtFile)
val ktReferences = findReferencesAtCaret(mainKtFile, caretPosition)
return modules.singleOrNull()
?: modules.find { it.name == "main" }
?: error("There should be a module named 'main' in the multi-module test.")
}
protected fun findMainFile(ktFiles: List<KtFile>): KtFile {
return ktFiles.singleOrNull()
?: ktFiles.firstOrNull { it.name == "main.kt" }
?: ktFiles.first()
}
protected fun doTestByFileStructure(ktFile: KtFile, caretPosition: Int, mainModule: TestModule, testServices: TestServices) {
val ktReferences = findReferencesAtCaret(ktFile, caretPosition)
if (ktReferences.isEmpty()) {
testServices.assertions.fail { "No references at caret found" }
}
@@ -0,0 +1,256 @@
/*
* 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.api.standalone.fir.test.cases.generated.cases.components.diagnosticProvider;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.standalone.fir.test.configurators.AnalysisApiFirStandaloneModeTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractDanglingFileCollectDiagnosticsTest;
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("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics")
@TestDataPath("$PROJECT_ROOT")
public class FirStandaloneNormalAnalysisSourceModuleDanglingFileCollectDiagnosticsTestGenerated extends AbstractDanglingFileCollectDiagnosticsTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Standalone
)
);
}
@Test
public void testAllFilesPresentInDiagnostics() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("annotationWithEnumFromDuplicatedLibrary.kt")
public void testAnnotationWithEnumFromDuplicatedLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/annotationWithEnumFromDuplicatedLibrary.kt");
}
@Test
@TestMetadata("declarationErrors.kt")
public void testDeclarationErrors() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/declarationErrors.kt");
}
@Test
@TestMetadata("delegationToLibraryInterface.kt")
public void testDelegationToLibraryInterface() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/delegationToLibraryInterface.kt");
}
@Test
@TestMetadata("duplicatedCallableWithImplicitType.kt")
public void testDuplicatedCallableWithImplicitType() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/duplicatedCallableWithImplicitType.kt");
}
@Test
@TestMetadata("errorsInFunctionalInterfacesInstances.kt")
public void testErrorsInFunctionalInterfacesInstances() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/errorsInFunctionalInterfacesInstances.kt");
}
@Test
@TestMetadata("incompleteDelegation.kt")
public void testIncompleteDelegation() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteDelegation.kt");
}
@Test
@TestMetadata("incompleteFor.kt")
public void testIncompleteFor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/incompleteFor.kt");
}
@Test
@TestMetadata("inferTypeFromGetValueDelegate.kt")
public void testInferTypeFromGetValueDelegate() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegate.kt");
}
@Test
@TestMetadata("inferTypeFromGetValueDelegateLibrary.kt")
public void testInferTypeFromGetValueDelegateLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/inferTypeFromGetValueDelegateLibrary.kt");
}
@Test
@TestMetadata("javaInnerClass.kt")
public void testJavaInnerClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClass.kt");
}
@Test
@TestMetadata("javaInnerClassFromAnotherModule.kt")
public void testJavaInnerClassFromAnotherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClassFromAnotherModule.kt");
}
@Test
@TestMetadata("javaInnerClassFromLibrary.kt")
public void testJavaInnerClassFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaInnerClassFromLibrary.kt");
}
@Test
@TestMetadata("javaNestedClass.kt")
public void testJavaNestedClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClass.kt");
}
@Test
@TestMetadata("javaNestedClassFromAnotherModule.kt")
public void testJavaNestedClassFromAnotherModule() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClassFromAnotherModule.kt");
}
@Test
@TestMetadata("javaNestedClassFromLibrary.kt")
public void testJavaNestedClassFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/javaNestedClassFromLibrary.kt");
}
@Test
@TestMetadata("overrideProtectedClassReturnFromLibrary.kt")
public void testOverrideProtectedClassReturnFromLibrary() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/overrideProtectedClassReturnFromLibrary.kt");
}
@Test
@TestMetadata("resolutionErrors.kt")
public void testResolutionErrors() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/resolutionErrors.kt");
}
@Test
@TestMetadata("typeMismatches.kt")
public void testTypeMismatches() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/typeMismatches.kt");
}
@Test
@TestMetadata("unresolved.kt")
public void testUnresolved() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolved.kt");
}
@Test
@TestMetadata("unresolvedAnnotationsOnPropertyFromParameter.kt")
public void testUnresolvedAnnotationsOnPropertyFromParameter() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedAnnotationsOnPropertyFromParameter.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCall.kt")
public void testUnresolvedReferenceInsideSuperConstructorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCall.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithLocalFunction.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithLocalFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithLocalFunction.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithPrimaryConstructor.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor.kt")
public void testUnresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperConstructorCallWithSecondaryConstructor.kt");
}
@Test
@TestMetadata("unresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction.kt")
public void testUnresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedReferenceInsideSuperPrimaryConstructorCallWithLocalFunction.kt");
}
@Test
@TestMetadata("unresolvedSuperConstructorCall.kt")
public void testUnresolvedSuperConstructorCall() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unresolvedSuperConstructorCall.kt");
}
@Test
@TestMetadata("unusedDestructuring.kt")
public void testUnusedDestructuring() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/unusedDestructuring.kt");
}
@Nested
@TestMetadata("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression")
@TestDataPath("$PROJECT_ROOT")
public class Suppression {
@Test
public void testAllFilesPresentInSuppression() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevel.kt")
public void testConflictingOverloadsAtTopLevel() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevel.kt");
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevel2.kt")
public void testConflictingOverloadsAtTopLevel2() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevel2.kt");
}
@Test
@TestMetadata("conflictingOverloadsAtTopLevelWithFileSuppression.kt")
public void testConflictingOverloadsAtTopLevelWithFileSuppression() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsAtTopLevelWithFileSuppression.kt");
}
@Test
@TestMetadata("conflictingOverloadsInClass.kt")
public void testConflictingOverloadsInClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsInClass.kt");
}
@Test
@TestMetadata("conflictingOverloadsInNestedClass.kt")
public void testConflictingOverloadsInNestedClass() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/conflictingOverloadsInNestedClass.kt");
}
@Test
@TestMetadata("deprecationAtTopLevel.kt")
public void testDeprecationAtTopLevel() throws Exception {
runTest("analysis/analysis-api/testData/components/diagnosticsProvider/diagnostics/suppression/deprecationAtTopLevel.kt");
}
}
}
@@ -0,0 +1,72 @@
/*
* 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.api.standalone.fir.test.cases.generated.cases.references;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analysis.api.standalone.fir.test.configurators.AnalysisApiFirStandaloneModeTestConfiguratorFactory;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfiguratorFactoryData;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiTestConfigurator;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.TestModuleKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.FrontendKind;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisSessionMode;
import org.jetbrains.kotlin.analysis.test.framework.test.configurators.AnalysisApiMode;
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.references.AbstractDanglingFileReferenceResolveTest;
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("analysis/analysis-api/testData/danglingFileReferenceResolve")
@TestDataPath("$PROJECT_ROOT")
public class FirStandaloneNormalAnalysisSourceModuleDanglingFileReferenceResolveTestGenerated extends AbstractDanglingFileReferenceResolveTest {
@NotNull
@Override
public AnalysisApiTestConfigurator getConfigurator() {
return AnalysisApiFirStandaloneModeTestConfiguratorFactory.INSTANCE.createConfigurator(
new AnalysisApiTestConfiguratorFactoryData(
FrontendKind.Fir,
TestModuleKind.Source,
AnalysisSessionMode.Normal,
AnalysisApiMode.Standalone
)
);
}
@Test
public void testAllFilesPresentInDanglingFileReferenceResolve() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/analysis-api/testData/danglingFileReferenceResolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@Test
@TestMetadata("classDifferentFile.kt")
public void testClassDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classDifferentFile.kt");
}
@Test
@TestMetadata("classSameFile.kt")
public void testClassSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/classSameFile.kt");
}
@Test
@TestMetadata("functionDifferentFile.kt")
public void testFunctionDifferentFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionDifferentFile.kt");
}
@Test
@TestMetadata("functionSameFile.kt")
public void testFunctionSameFile() throws Exception {
runTest("analysis/analysis-api/testData/danglingFileReferenceResolve/functionSameFile.kt");
}
}
@@ -0,0 +1,9 @@
// FILE: lib.kt
class Foo
// FILE: main.kt
fun test() {
Fo<caret>o()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in Foo) constructor() [lib.kt]
@@ -0,0 +1,5 @@
class Foo
fun test() {
Fo<caret>o()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in Foo) constructor() [fake.kt]
@@ -0,0 +1,9 @@
// FILE: lib.kt
fun foo() {}
// FILE: main.kt
fun test() {
fo<caret>o()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in ROOT) fun foo() [lib.kt]
@@ -0,0 +1,5 @@
fun foo() {}
fun test() {
fo<caret>o()
}
@@ -0,0 +1,2 @@
Resolved to:
0: (in ROOT) fun foo() [fake.kt]
@@ -0,0 +1,41 @@
/*
* Copyright 2010-2023 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.file.structure
import com.intellij.psi.util.PsiTreeUtil
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.test.framework.services.expressionMarkerProvider
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.test.services.TestModuleStructure
import org.jetbrains.kotlin.test.services.TestServices
abstract class AbstractDanglingFileInBlockModificationTes : AbstractInBlockModificationTest() {
override fun doTestByFileStructure(ktFile: KtFile, moduleStructure: TestModuleStructure, testServices: TestServices) {
val selectedElement = testServices.expressionMarkerProvider
.getSelectedElementOfTypeByDirective(ktFile, moduleStructure.modules.single())
val ktPsiFactory = KtPsiFactory.contextual(ktFile, markGenerated = true, eventSystemEnabled = true)
val fakeKtFile = ktPsiFactory.createFile(ktFile.name, ktFile.text)
val fakeSelectedElement = PsiTreeUtil.findSameElementInCopy(selectedElement, fakeKtFile)
doTest(fakeKtFile, fakeSelectedElement, moduleStructure, testServices)
}
}
abstract class AbstractSourceDanglingFileInBlockModificationTest : AbstractDanglingFileInBlockModificationTes() {
override val configurator = AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false)
}
abstract class AbstractOutOfContentRootDanglingFileInBlockModificationTest : AbstractDanglingFileInBlockModificationTes() {
override val configurator get() = AnalysisApiFirOutOfContentRootTestConfigurator
}
abstract class AbstractScriptDanglingFileInBlockModificationTest : AbstractDanglingFileInBlockModificationTes() {
override val configurator = AnalysisApiFirScriptTestConfigurator(analyseInDependentSession = false)
}
@@ -47,6 +47,10 @@ abstract class AbstractInBlockModificationTest : AbstractLowLevelApiSingleFileTe
module = moduleStructure.modules.last(),
)
doTest(ktFile, selectedElement, moduleStructure, testServices)
}
protected fun doTest(ktFile: KtFile, selectedElement: PsiElement, moduleStructure: TestModuleStructure, testServices: TestServices) {
val actual = testInBlockModification(
file = ktFile,
elementToModify = selectedElement,
@@ -0,0 +1,446 @@
/*
* 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.file.structure;
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("analysis/low-level-api-fir/testData/inBlockModification")
@TestDataPath("$PROJECT_ROOT")
public class OutOfContentRootDanglingFileInBlockModificationTestGenerated extends AbstractOutOfContentRootDanglingFileInBlockModificationTest {
@Test
public void testAllFilesPresentInInBlockModification() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/inBlockModification"), Pattern.compile("^(.+)\\.(kt)$"), null, false);
}
@Test
@TestMetadata("contract.kt")
public void testContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/contract.kt");
}
@Test
@TestMetadata("entireContract.kt")
public void testEntireContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireContract.kt");
}
@Test
@TestMetadata("entireFunctionBody.kt")
public void testEntireFunctionBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireFunctionBody.kt");
}
@Test
@TestMetadata("entireGetterBody.kt")
public void testEntireGetterBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireGetterBody.kt");
}
@Test
@TestMetadata("entireInitializer.kt")
public void testEntireInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireInitializer.kt");
}
@Test
@TestMetadata("entireSetterBody.kt")
public void testEntireSetterBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireSetterBody.kt");
}
@Test
@TestMetadata("extensionWithDefaultParameters.kt")
public void testExtensionWithDefaultParameters() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/extensionWithDefaultParameters.kt");
}
@Test
@TestMetadata("functionWithDefaultParameters.kt")
public void testFunctionWithDefaultParameters() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/functionWithDefaultParameters.kt");
}
@Test
@TestMetadata("insideContract.kt")
public void testInsideContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideContract.kt");
}
@Test
@TestMetadata("insideDefaultParameter.kt")
public void testInsideDefaultParameter() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideDefaultParameter.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithContract.kt")
public void testMemberFunWithBodyWithContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithErrorContract.kt")
public void testMemberFunWithBodyWithErrorContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithErrorContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithFakeContract.kt")
public void testMemberFunWithBodyWithFakeContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithFakeContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithType.kt")
public void testMemberFunWithBodyWithType() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithType.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithoutType.kt")
public void testMemberFunWithBodyWithoutType() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutType.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithoutTypeWithoutName.kt")
public void testMemberFunWithBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithTypeWithoutBody.kt")
public void testMemberFunWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberFunWithoutBodyWithTypeWithoutName.kt")
public void testMemberFunWithoutBodyWithTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithoutBodyWithoutTypeWithoutName.kt")
public void testMemberFunWithoutBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithoutTypeWithoutBody.kt")
public void testMemberFunWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberGetterWithBodyWithContract.kt")
public void testMemberGetterWithBodyWithContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContract.kt");
}
@Test
@TestMetadata("memberGetterWithBodyWithContractWithoutName.kt")
public void testMemberGetterWithBodyWithContractWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContractWithoutName.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithBody.kt")
public void testMemberGetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBody.kt")
public void testMemberGetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBodyWithoutName.kt")
public void testMemberGetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithBody.kt")
public void testMemberGetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithoutBody.kt")
public void testMemberGetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegate.kt")
public void testMemberPropertyWithTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegateWithoutName.kt")
public void testMemberPropertyWithTypeInDelegateWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegateWithoutName.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInErrorDelegate.kt")
public void testMemberPropertyWithTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializer.kt")
public void testMemberPropertyWithTypeInInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializer.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializerWithoutName.kt")
public void testMemberPropertyWithTypeInInitializerWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializerWithoutName.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInDelegate.kt")
public void testMemberPropertyWithoutTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInErrorDelegate.kt")
public void testMemberPropertyWithoutTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInInitializer.kt")
public void testMemberPropertyWithoutTypeInInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInInitializer.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithBody.kt")
public void testMemberSetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithBodyWithoutName.kt")
public void testMemberSetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBody.kt")
public void testMemberSetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBodyWithoutName.kt")
public void testMemberSetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithBody.kt")
public void testMemberSetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithoutBody.kt")
public void testMemberSetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("rawContract.kt")
public void testRawContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/rawContract.kt");
}
@Test
@TestMetadata("topLevelFunctionWithBodyWithoutTypeWithoutName.kt")
public void testTopLevelFunctionWithBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithBody.kt")
public void testTopLevelFunctionWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithBodyDumpFile.kt")
public void testTopLevelFunctionWithTypeWithBodyDumpFile() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithBodyDumpFile.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithoutBody.kt")
public void testTopLevelFunctionWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithTypeWithoutName.kt")
public void testTopLevelFunctionWithoutBodyWithTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithoutTypeWithoutName.kt")
public void testTopLevelFunctionWithoutBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithBody.kt")
public void testTopLevelFunctionWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithoutBody.kt")
public void testTopLevelFunctionWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBody.kt")
public void testTopLevelGetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBodyWithoutName.kt")
public void testTopLevelGetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBody.kt")
public void testTopLevelGetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBodyWithoutName.kt")
public void testTopLevelGetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithBody.kt")
public void testTopLevelGetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithoutBody.kt")
public void testTopLevelGetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegate.kt")
public void testTopLevelPropertyWithTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegateWithoutName.kt")
public void testTopLevelPropertyWithTypeInDelegateWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegateWithoutName.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInErrorDelegate.kt")
public void testTopLevelPropertyWithTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzer.kt")
public void testTopLevelPropertyWithTypeInInititalzer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzer.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzerWithoutName.kt")
public void testTopLevelPropertyWithTypeInInititalzerWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzerWithoutName.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInDelegate.kt")
public void testTopLevelPropertyWithoutTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInErrorDelegate.kt")
public void testTopLevelPropertyWithoutTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInInititalzer.kt")
public void testTopLevelPropertyWithoutTypeInInititalzer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInInititalzer.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBody.kt")
public void testTopLevelSetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBodyWithoutName.kt")
public void testTopLevelSetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBody.kt")
public void testTopLevelSetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBodyWithoutName.kt")
public void testTopLevelSetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithBody.kt")
public void testTopLevelSetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithoutBody.kt")
public void testTopLevelSetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithoutBody.kt");
}
}
@@ -0,0 +1,464 @@
/*
* 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.file.structure;
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("analysis/low-level-api-fir/testData/inBlockModification")
@TestDataPath("$PROJECT_ROOT")
public class ScriptDanglingFileInBlockModificationTestGenerated extends AbstractScriptDanglingFileInBlockModificationTest {
@Test
public void testAllFilesPresentInInBlockModification() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/inBlockModification"), Pattern.compile("^(.+)\\.(kts)$"), null, false);
}
@Test
@TestMetadata("assignment.kts")
public void testAssignment() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/assignment.kts");
}
@Test
@TestMetadata("contractScript.kts")
public void testContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/contractScript.kts");
}
@Test
@TestMetadata("entireContractScript.kts")
public void testEntireContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireContractScript.kts");
}
@Test
@TestMetadata("entireFunctionBodyScript.kts")
public void testEntireFunctionBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireFunctionBodyScript.kts");
}
@Test
@TestMetadata("entireGetterBodyScript.kts")
public void testEntireGetterBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireGetterBodyScript.kts");
}
@Test
@TestMetadata("entireInitializerScript.kts")
public void testEntireInitializerScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireInitializerScript.kts");
}
@Test
@TestMetadata("entireSetterBodyScript.kts")
public void testEntireSetterBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireSetterBodyScript.kts");
}
@Test
@TestMetadata("extensionWithDefaultParametersScript.kts")
public void testExtensionWithDefaultParametersScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/extensionWithDefaultParametersScript.kts");
}
@Test
@TestMetadata("functionWithDefaultParametersScript.kts")
public void testFunctionWithDefaultParametersScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/functionWithDefaultParametersScript.kts");
}
@Test
@TestMetadata("insideContractScript.kts")
public void testInsideContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideContractScript.kts");
}
@Test
@TestMetadata("insideDefaultParameterScript.kts")
public void testInsideDefaultParameterScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideDefaultParameterScript.kts");
}
@Test
@TestMetadata("insideStatement.kts")
public void testInsideStatement() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideStatement.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithContractScript.kts")
public void testMemberFunWithBodyWithContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithContractScript.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithErrorContractScript.kts")
public void testMemberFunWithBodyWithErrorContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithErrorContractScript.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithFakeContractScript.kts")
public void testMemberFunWithBodyWithFakeContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithFakeContractScript.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithTypeScript.kts")
public void testMemberFunWithBodyWithTypeScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithTypeScript.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithoutTypeScript.kts")
public void testMemberFunWithBodyWithoutTypeScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutTypeScript.kts");
}
@Test
@TestMetadata("memberFunWithBodyWithoutTypeWithoutNameScript.kts")
public void testMemberFunWithBodyWithoutTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("memberFunWithTypeWithoutBodyScript.kts")
public void testMemberFunWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("memberFunWithoutBodyWithTypeWithoutNameScript.kts")
public void testMemberFunWithoutBodyWithTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("memberFunWithoutBodyWithoutTypeWithoutNameScript.kts")
public void testMemberFunWithoutBodyWithoutTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithoutTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("memberFunWithoutTypeWithoutBodyScript.kts")
public void testMemberFunWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("memberGetterWithBodyWithContractScript.kts")
public void testMemberGetterWithBodyWithContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContractScript.kts");
}
@Test
@TestMetadata("memberGetterWithBodyWithContractWithoutNameScript.kts")
public void testMemberGetterWithBodyWithContractWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContractWithoutNameScript.kts");
}
@Test
@TestMetadata("memberGetterWithTypeWithBodyScript.kts")
public void testMemberGetterWithTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithBodyScript.kts");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBodyScript.kts")
public void testMemberGetterWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBodyWithoutNameScript.kts")
public void testMemberGetterWithTypeWithoutBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithBodyScript.kts")
public void testMemberGetterWithoutTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithBodyScript.kts");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithoutBodyScript.kts")
public void testMemberGetterWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegateScript.kts")
public void testMemberPropertyWithTypeInDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegateScript.kts");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegateWithoutNameScript.kts")
public void testMemberPropertyWithTypeInDelegateWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegateWithoutNameScript.kts");
}
@Test
@TestMetadata("memberPropertyWithTypeInErrorDelegateScript.kts")
public void testMemberPropertyWithTypeInErrorDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInErrorDelegateScript.kts");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializerScript.kts")
public void testMemberPropertyWithTypeInInitializerScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializerScript.kts");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializerWithoutNameScript.kts")
public void testMemberPropertyWithTypeInInitializerWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializerWithoutNameScript.kts");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInDelegateScript.kts")
public void testMemberPropertyWithoutTypeInDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInDelegateScript.kts");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInErrorDelegateScript.kts")
public void testMemberPropertyWithoutTypeInErrorDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInErrorDelegateScript.kts");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInInitializerScript.kts")
public void testMemberPropertyWithoutTypeInInitializerScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInInitializerScript.kts");
}
@Test
@TestMetadata("memberSetterWithTypeWithBodyScript.kts")
public void testMemberSetterWithTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBodyScript.kts");
}
@Test
@TestMetadata("memberSetterWithTypeWithBodyWithoutNameScript.kts")
public void testMemberSetterWithTypeWithBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBodyScript.kts")
public void testMemberSetterWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBodyWithoutNameScript.kts")
public void testMemberSetterWithTypeWithoutBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithBodyScript.kts")
public void testMemberSetterWithoutTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithBodyScript.kts");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithoutBodyScript.kts")
public void testMemberSetterWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("rawContractScript.kts")
public void testRawContractScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/rawContractScript.kts");
}
@Test
@TestMetadata("statement.kts")
public void testStatement() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/statement.kts");
}
@Test
@TestMetadata("statement2.kts")
public void testStatement2() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/statement2.kts");
}
@Test
@TestMetadata("topLevelFunctionWithBodyWithoutTypeWithoutNameScript.kts")
public void testTopLevelFunctionWithBodyWithoutTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithBodyWithoutTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithBodyScript.kts")
public void testTopLevelFunctionWithTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithoutBodyScript.kts")
public void testTopLevelFunctionWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithTypeWithoutNameScript.kts")
public void testTopLevelFunctionWithoutBodyWithTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithoutTypeWithoutNameScript.kts")
public void testTopLevelFunctionWithoutBodyWithoutTypeWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithoutTypeWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithBodyScript.kts")
public void testTopLevelFunctionWithoutTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithoutBodyScript.kts")
public void testTopLevelFunctionWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBodyScript.kts")
public void testTopLevelGetterWithTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBodyWithoutNameScript.kts")
public void testTopLevelGetterWithTypeWithBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBodyScript.kts")
public void testTopLevelGetterWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBodyWithoutNameScript.kts")
public void testTopLevelGetterWithTypeWithoutBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithBodyScript.kts")
public void testTopLevelGetterWithoutTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithoutBodyScript.kts")
public void testTopLevelGetterWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegateScript.kts")
public void testTopLevelPropertyWithTypeInDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegateScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegateWithoutNameScript.kts")
public void testTopLevelPropertyWithTypeInDelegateWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegateWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInErrorDelegateScript.kts")
public void testTopLevelPropertyWithTypeInErrorDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInErrorDelegateScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzerScript.kts")
public void testTopLevelPropertyWithTypeInInititalzerScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzerScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzerWithoutNameScript.kts")
public void testTopLevelPropertyWithTypeInInititalzerWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzerWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInDelegateScript.kts")
public void testTopLevelPropertyWithoutTypeInDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInDelegateScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInErrorDelegateScript.kts")
public void testTopLevelPropertyWithoutTypeInErrorDelegateScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInErrorDelegateScript.kts");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInInititalzerScript.kts")
public void testTopLevelPropertyWithoutTypeInInititalzerScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInInititalzerScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBodyScript.kts")
public void testTopLevelSetterWithTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBodyWithoutNameScript.kts")
public void testTopLevelSetterWithTypeWithBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBodyScript.kts")
public void testTopLevelSetterWithTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBodyScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBodyWithoutNameScript.kts")
public void testTopLevelSetterWithTypeWithoutBodyWithoutNameScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBodyWithoutNameScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithBodyScript.kts")
public void testTopLevelSetterWithoutTypeWithBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithBodyScript.kts");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithoutBodyScript.kts")
public void testTopLevelSetterWithoutTypeWithoutBodyScript() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithoutBodyScript.kts");
}
}
@@ -0,0 +1,446 @@
/*
* 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.file.structure;
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("analysis/low-level-api-fir/testData/inBlockModification")
@TestDataPath("$PROJECT_ROOT")
public class SourceDanglingFileInBlockModificationTestGenerated extends AbstractSourceDanglingFileInBlockModificationTest {
@Test
public void testAllFilesPresentInInBlockModification() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/inBlockModification"), Pattern.compile("^(.+)\\.(kt)$"), null, false);
}
@Test
@TestMetadata("contract.kt")
public void testContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/contract.kt");
}
@Test
@TestMetadata("entireContract.kt")
public void testEntireContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireContract.kt");
}
@Test
@TestMetadata("entireFunctionBody.kt")
public void testEntireFunctionBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireFunctionBody.kt");
}
@Test
@TestMetadata("entireGetterBody.kt")
public void testEntireGetterBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireGetterBody.kt");
}
@Test
@TestMetadata("entireInitializer.kt")
public void testEntireInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireInitializer.kt");
}
@Test
@TestMetadata("entireSetterBody.kt")
public void testEntireSetterBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/entireSetterBody.kt");
}
@Test
@TestMetadata("extensionWithDefaultParameters.kt")
public void testExtensionWithDefaultParameters() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/extensionWithDefaultParameters.kt");
}
@Test
@TestMetadata("functionWithDefaultParameters.kt")
public void testFunctionWithDefaultParameters() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/functionWithDefaultParameters.kt");
}
@Test
@TestMetadata("insideContract.kt")
public void testInsideContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideContract.kt");
}
@Test
@TestMetadata("insideDefaultParameter.kt")
public void testInsideDefaultParameter() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/insideDefaultParameter.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithContract.kt")
public void testMemberFunWithBodyWithContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithErrorContract.kt")
public void testMemberFunWithBodyWithErrorContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithErrorContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithFakeContract.kt")
public void testMemberFunWithBodyWithFakeContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithFakeContract.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithType.kt")
public void testMemberFunWithBodyWithType() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithType.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithoutType.kt")
public void testMemberFunWithBodyWithoutType() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutType.kt");
}
@Test
@TestMetadata("memberFunWithBodyWithoutTypeWithoutName.kt")
public void testMemberFunWithBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithTypeWithoutBody.kt")
public void testMemberFunWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberFunWithoutBodyWithTypeWithoutName.kt")
public void testMemberFunWithoutBodyWithTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithoutBodyWithoutTypeWithoutName.kt")
public void testMemberFunWithoutBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("memberFunWithoutTypeWithoutBody.kt")
public void testMemberFunWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberFunWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberGetterWithBodyWithContract.kt")
public void testMemberGetterWithBodyWithContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContract.kt");
}
@Test
@TestMetadata("memberGetterWithBodyWithContractWithoutName.kt")
public void testMemberGetterWithBodyWithContractWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithBodyWithContractWithoutName.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithBody.kt")
public void testMemberGetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBody.kt")
public void testMemberGetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberGetterWithTypeWithoutBodyWithoutName.kt")
public void testMemberGetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithBody.kt")
public void testMemberGetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("memberGetterWithoutTypeWithoutBody.kt")
public void testMemberGetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberGetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegate.kt")
public void testMemberPropertyWithTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInDelegateWithoutName.kt")
public void testMemberPropertyWithTypeInDelegateWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInDelegateWithoutName.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInErrorDelegate.kt")
public void testMemberPropertyWithTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializer.kt")
public void testMemberPropertyWithTypeInInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializer.kt");
}
@Test
@TestMetadata("memberPropertyWithTypeInInitializerWithoutName.kt")
public void testMemberPropertyWithTypeInInitializerWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithTypeInInitializerWithoutName.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInDelegate.kt")
public void testMemberPropertyWithoutTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInErrorDelegate.kt")
public void testMemberPropertyWithoutTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("memberPropertyWithoutTypeInInitializer.kt")
public void testMemberPropertyWithoutTypeInInitializer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberPropertyWithoutTypeInInitializer.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithBody.kt")
public void testMemberSetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithBodyWithoutName.kt")
public void testMemberSetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBody.kt")
public void testMemberSetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("memberSetterWithTypeWithoutBodyWithoutName.kt")
public void testMemberSetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithBody.kt")
public void testMemberSetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("memberSetterWithoutTypeWithoutBody.kt")
public void testMemberSetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/memberSetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("rawContract.kt")
public void testRawContract() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/rawContract.kt");
}
@Test
@TestMetadata("topLevelFunctionWithBodyWithoutTypeWithoutName.kt")
public void testTopLevelFunctionWithBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithBody.kt")
public void testTopLevelFunctionWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithBodyDumpFile.kt")
public void testTopLevelFunctionWithTypeWithBodyDumpFile() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithBodyDumpFile.kt");
}
@Test
@TestMetadata("topLevelFunctionWithTypeWithoutBody.kt")
public void testTopLevelFunctionWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithTypeWithoutName.kt")
public void testTopLevelFunctionWithoutBodyWithTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutBodyWithoutTypeWithoutName.kt")
public void testTopLevelFunctionWithoutBodyWithoutTypeWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutBodyWithoutTypeWithoutName.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithBody.kt")
public void testTopLevelFunctionWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelFunctionWithoutTypeWithoutBody.kt")
public void testTopLevelFunctionWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelFunctionWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBody.kt")
public void testTopLevelGetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithBodyWithoutName.kt")
public void testTopLevelGetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBody.kt")
public void testTopLevelGetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithTypeWithoutBodyWithoutName.kt")
public void testTopLevelGetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithBody.kt")
public void testTopLevelGetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelGetterWithoutTypeWithoutBody.kt")
public void testTopLevelGetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelGetterWithoutTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegate.kt")
public void testTopLevelPropertyWithTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInDelegateWithoutName.kt")
public void testTopLevelPropertyWithTypeInDelegateWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInDelegateWithoutName.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInErrorDelegate.kt")
public void testTopLevelPropertyWithTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzer.kt")
public void testTopLevelPropertyWithTypeInInititalzer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzer.kt");
}
@Test
@TestMetadata("topLevelPropertyWithTypeInInititalzerWithoutName.kt")
public void testTopLevelPropertyWithTypeInInititalzerWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithTypeInInititalzerWithoutName.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInDelegate.kt")
public void testTopLevelPropertyWithoutTypeInDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInErrorDelegate.kt")
public void testTopLevelPropertyWithoutTypeInErrorDelegate() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInErrorDelegate.kt");
}
@Test
@TestMetadata("topLevelPropertyWithoutTypeInInititalzer.kt")
public void testTopLevelPropertyWithoutTypeInInititalzer() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelPropertyWithoutTypeInInititalzer.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBody.kt")
public void testTopLevelSetterWithTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithBodyWithoutName.kt")
public void testTopLevelSetterWithTypeWithBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBody.kt")
public void testTopLevelSetterWithTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithTypeWithoutBodyWithoutName.kt")
public void testTopLevelSetterWithTypeWithoutBodyWithoutName() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithTypeWithoutBodyWithoutName.kt");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithBody.kt")
public void testTopLevelSetterWithoutTypeWithBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithBody.kt");
}
@Test
@TestMetadata("topLevelSetterWithoutTypeWithoutBody.kt")
public void testTopLevelSetterWithoutTypeWithoutBody() throws Exception {
runTest("analysis/low-level-api-fir/testData/inBlockModification/topLevelSetterWithoutTypeWithoutBody.kt");
}
}
@@ -17,6 +17,7 @@ import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.contain
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.containingDeclarationProvider.AbstractContainingDeclarationProviderByPsiTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractCodeFragmentCollectDiagnosticsTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractCollectDiagnosticsTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.diagnosticProvider.AbstractDanglingFileCollectDiagnosticsTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.expressionInfoProvider.AbstractIsUsedAsExpressionTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.expressionInfoProvider.AbstractReturnTargetSymbolTest
import org.jetbrains.kotlin.analysis.api.impl.base.test.cases.components.expressionInfoProvider.AbstractWhenMissingCasesTest
@@ -89,6 +90,14 @@ internal fun AnalysisApiTestGroup.generateAnalysisApiTests() {
}
}
test(
AbstractDanglingFileReferenceResolveTest::class,
filter = frontendIs(FrontendKind.Fir)
and testModuleKindIs(TestModuleKind.Source, TestModuleKind.LibrarySource)
) {
model("danglingFileReferenceResolve", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME)
}
component(
"compilerFacility",
filter = testModuleKindIs(TestModuleKind.Source, TestModuleKind.LibrarySource)
@@ -324,6 +333,10 @@ private fun AnalysisApiTestGroup.generateAnalysisApiComponentsTests() {
model(it, "diagnostics")
}
test(AbstractDanglingFileCollectDiagnosticsTest::class, filter = frontendIs(FrontendKind.Fir)) {
model(it, "diagnostics")
}
test(
AbstractCodeFragmentCollectDiagnosticsTest::class,
filter = testModuleKindIs(TestModuleKind.Source) and frontendIs(FrontendKind.Fir),
@@ -117,6 +117,18 @@ internal fun TestGroupSuite.generateFirLowLevelApiTests() {
model("inBlockModification", recursive = false, pattern = TestGeneratorUtil.KTS)
}
testClass<AbstractSourceDanglingFileInBlockModificationTest> {
model("inBlockModification", recursive = false, pattern = TestGeneratorUtil.KT)
}
testClass<AbstractOutOfContentRootDanglingFileInBlockModificationTest> {
model("inBlockModification", recursive = false, pattern = TestGeneratorUtil.KT)
}
testClass<AbstractScriptDanglingFileInBlockModificationTest> {
model("inBlockModification", recursive = false, pattern = TestGeneratorUtil.KTS)
}
testClass<AbstractCodeFragmentInBlockModificationTest> {
model("inBlockModification/codeFragments", recursive = false, pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME)
}