From 7765fd3df4bff7a8c0c19a76d2e64b5f794119d2 Mon Sep 17 00:00:00 2001 From: Yan Zhulanow Date: Thu, 16 Jul 2020 21:04:55 +0900 Subject: [PATCH] Inline getLocalPath() GitOrigin-RevId: 8a3fc7b6284cf0edc814a311f1c94bbfd07c4332 --- .../test/weighers/AbstractCompletionWeigherTest.kt | 6 +++++- .../idea/codeInsight/moveUpDown/AbstractCodeMoverTest.kt | 2 +- .../idea/test/KotlinLightCodeInsightFixtureTestCase.kt | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/kotlin/completion/tests/test/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt b/plugins/kotlin/completion/tests/test/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt index 2ac993a02a89..af8e54262d49 100644 --- a/plugins/kotlin/completion/tests/test/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt +++ b/plugins/kotlin/completion/tests/test/org/jetbrains/kotlin/idea/completion/test/weighers/AbstractCompletionWeigherTest.kt @@ -12,11 +12,15 @@ import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescrip import org.jetbrains.kotlin.idea.test.withCustomCompilerOptions import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.junit.Assert +import java.io.File abstract class AbstractCompletionWeigherTest(val completionType: CompletionType, val relativeTestDataPath: String) : KotlinLightCodeInsightFixtureTestCase() { fun doTest(path: String) { - myFixture.configureWithExtraFile(getLocalPath(path), ".Data", ".Data1", ".Data2", ".Data3", ".Data4", ".Data5", ".Data6") + myFixture.configureWithExtraFile( + File(path).toRelativeString(File(testDataPath)), + ".Data", ".Data1", ".Data2", ".Data3", ".Data4", ".Data5", ".Data6" + ) val text = myFixture.editor.document.text diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/moveUpDown/AbstractCodeMoverTest.kt b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/moveUpDown/AbstractCodeMoverTest.kt index d7841ad8ad01..b543e55811f7 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/moveUpDown/AbstractCodeMoverTest.kt +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/idea/codeInsight/moveUpDown/AbstractCodeMoverTest.kt @@ -110,7 +110,7 @@ abstract class AbstractCodeMoverTest : KotlinLightCodeInsightFixtureTestCase() { if (isApplicableExpected) { val afterFile = File("$path.after") try { - myFixture.checkResultByFile(getLocalPath(afterFile.absolutePath)) + myFixture.checkResultByFile(afterFile.toRelativeString(File(testDataPath))) } catch (e: ComparisonFailure) { KotlinTestUtils.assertEqualsToFile(afterFile, editor) } diff --git a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt index 89ac4a29fec0..2a48fdf5cc19 100644 --- a/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt +++ b/plugins/kotlin/test-framework/test/org/jetbrains/kotlin/idea/test/KotlinLightCodeInsightFixtureTestCase.kt @@ -70,8 +70,6 @@ abstract class KotlinLightCodeInsightFixtureTestCase : KotlinLightCodeInsightFix protected open fun fileName(): String = KotlinTestUtils.getTestDataFileName(this::class.java, this.name) ?: (getTestName(false) + ".kt") - protected fun getLocalPath(path: String): String = File(path).toRelativeString(File(testDataPath)) - override fun getTestDataPath(): String = TestMetadataUtil.getTestDataPath(javaClass) override fun setUp() {