[kotlin] Add test for obsolete issue

^KTIJ-10245 Obsolete

GitOrigin-RevId: 76acc582d82ae65903ffefa11acb14e551e2e9a2
This commit is contained in:
Alexey Belkov
2022-11-22 12:31:30 +00:00
committed by intellij-monorepo-bot
parent 06fa081e6d
commit 228ab8643b
4 changed files with 21 additions and 0 deletions
@@ -25,6 +25,7 @@ import junit.framework.TestCase
import org.jetbrains.kotlin.formatter.FormatSettingsUtil
import org.jetbrains.kotlin.idea.KotlinLanguage
import org.jetbrains.kotlin.idea.codeInsight.hints.KotlinAbstractHintsProvider
import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager
import org.jetbrains.kotlin.idea.test.*
import org.jetbrains.kotlin.idea.util.application.executeCommand
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
@@ -124,6 +125,10 @@ abstract class AbstractIntentionTestBase : KotlinLightCodeInsightFixtureTestCase
val pathToFiles = mapOf(*(sourceFilePaths zip psiFiles).toTypedArray())
ConfigLibraryUtil.configureLibrariesByDirective(module, fileText)
if ((myFixture.file as? KtFile)?.isScript() == true) {
ScriptConfigurationManager.updateScriptDependenciesSynchronously(myFixture.file)
}
configureCodeStyleAndRun(project, { FormatSettingsUtil.createConfigurator(fileText, it).configureSettings() }) {
configureRegistryAndRun(fileText) {
try {
@@ -14107,6 +14107,11 @@ public abstract class K1IntentionTestGenerated extends AbstractK1IntentionTest {
public void testRedeclarationPropertyConflict() throws Exception {
runTest("testData/intentions/moveMemberToTopLevel/redeclarationPropertyConflict.kt");
}
@TestMetadata("script.kts")
public void testScript() throws Exception {
runTest("testData/intentions/moveMemberToTopLevel/script.kts");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@@ -0,0 +1,5 @@
// RUNTIME_WITH_SCRIPT_RUNTIME
object Foo {
fun <caret>foo() = 1
val a = 1
}
@@ -0,0 +1,6 @@
// RUNTIME_WITH_SCRIPT_RUNTIME
object Foo {
val a = 1
}
fun foo() = 1