diff --git a/plugins/kotlin/code-insight/intentions-k2/tests/test/org/jetbrains/kotlin/idea/k2/intentions/tests/AbstractK2IntentionTest.kt b/plugins/kotlin/code-insight/intentions-k2/tests/test/org/jetbrains/kotlin/idea/k2/intentions/tests/AbstractK2IntentionTest.kt index 249d17df99af..b626305a1a13 100644 --- a/plugins/kotlin/code-insight/intentions-k2/tests/test/org/jetbrains/kotlin/idea/k2/intentions/tests/AbstractK2IntentionTest.kt +++ b/plugins/kotlin/code-insight/intentions-k2/tests/test/org/jetbrains/kotlin/idea/k2/intentions/tests/AbstractK2IntentionTest.kt @@ -21,6 +21,13 @@ abstract class AbstractK2IntentionTest : AbstractIntentionTestBase() { else super.afterFileNameSuffix(ktFilePath) } + override fun fileName(): String { + val fileName = super.fileName() + val firFileName = IgnoreTests.deriveFirFileName(fileName) + + return if (File(testDataDirectory, firFileName).exists()) firFileName else fileName + } + override fun isFirPlugin() = true override fun getDefaultProjectDescriptor(): KotlinLightProjectDescriptor { diff --git a/plugins/kotlin/frontend-independent/tests/test/org/jetbrains/kotlin/test/utils/IgnoreTests.kt b/plugins/kotlin/frontend-independent/tests/test/org/jetbrains/kotlin/test/utils/IgnoreTests.kt index c521afbfb822..803002606bc2 100644 --- a/plugins/kotlin/frontend-independent/tests/test/org/jetbrains/kotlin/test/utils/IgnoreTests.kt +++ b/plugins/kotlin/frontend-independent/tests/test/org/jetbrains/kotlin/test/utils/IgnoreTests.kt @@ -339,6 +339,8 @@ object IgnoreTests { private fun deriveFirTestFile(originalTestFile: File): File { val name = originalTestFile.name - return originalTestFile.parentFile.resolve(name.substringBeforeLast('.') + ".fir." + name.substringAfterLast('.')) + return originalTestFile.parentFile.resolve(deriveFirFileName(name)) } + + fun deriveFirFileName(fileName: String): String = fileName.substringBeforeLast('.') + ".fir." + fileName.substringAfterLast('.') } diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt new file mode 100644 index 000000000000..a533e52f239c --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt @@ -0,0 +1,7 @@ +open class Foo { + fun bar() { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt.after b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt.after new file mode 100644 index 000000000000..eefeec96ebbc --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.fir.kt.after @@ -0,0 +1,7 @@ +open class Foo { + open fun bar() { + fun foo() { + + } + } +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.kt b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.kt index a27e49c03ed9..4cc575668326 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localFunction.kt @@ -1,5 +1,4 @@ // IS_APPLICABLE: false - open class Foo { fun bar() { fun foo() { diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt new file mode 100644 index 000000000000..5baff59c5be4 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt @@ -0,0 +1,6 @@ +// AFTER-WARNING: Variable 'foo' is never used +open class Foo { + fun bar() { + var foo = 1 + } +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt.after b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt.after new file mode 100644 index 000000000000..905358aca251 --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.fir.kt.after @@ -0,0 +1,6 @@ +// AFTER-WARNING: Variable 'foo' is never used +open class Foo { + open fun bar() { + var foo = 1 + } +} \ No newline at end of file diff --git a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.kt b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.kt index bc8a6ee0972f..c40588b35a73 100644 --- a/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.kt +++ b/plugins/kotlin/idea/tests/testData/intentions/addOpenModifier/localProperty.kt @@ -1,5 +1,4 @@ // IS_APPLICABLE: false - open class Foo { fun bar() { var foo = 1