[kotlin] k2 extract function: additional test data

^KTIJ-10882 fixed

GitOrigin-RevId: 70235fef1f911c4da79ac93f684c6d459756c7e4
This commit is contained in:
Anna Kozlova
2024-03-27 19:30:43 +00:00
committed by intellij-monorepo-bot
parent be5bf8b03b
commit 2db4d477e8
4 changed files with 32 additions and 0 deletions
@@ -1080,6 +1080,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest {
runTest("testData/refactoring/extractFunction/basic/topLevelValUnderSmartCast.kt");
}
@TestMetadata("typedFunctionLiteral.kt")
public void testTypedFunctionLiteral() throws Exception {
runTest("testData/refactoring/extractFunction/basic/typedFunctionLiteral.kt");
}
@TestMetadata("unnecessaryNullabilityAnnotation.kt")
public void testUnnecessaryNullabilityAnnotation() throws Exception {
runTest("testData/refactoring/extractFunction/basic/unnecessaryNullabilityAnnotation.kt");
@@ -0,0 +1,10 @@
class Bar
class Foo {
fun bar(block: (Bar) -> Int) {}
init {
bar(<selection>{ bar -> 1 }</selection>)
}
}
// IGNORE_K1
@@ -0,0 +1,12 @@
class Bar
class Foo {
fun bar(block: (Bar) -> Int) {}
init {
bar(function())
}
private fun function(): (Bar) -> Int = { bar -> 1 }
}
// IGNORE_K1
@@ -301,6 +301,11 @@ public abstract class K2IntroduceFunctionTestGenerated extends AbstractK2Introdu
runTest("../../idea/tests/testData/refactoring/extractFunction/basic/topLevelValUnderSmartCast.kt");
}
@TestMetadata("typedFunctionLiteral.kt")
public void testTypedFunctionLiteral() throws Exception {
runTest("../../idea/tests/testData/refactoring/extractFunction/basic/typedFunctionLiteral.kt");
}
@TestMetadata("unnecessaryNullabilityAnnotation.kt")
public void testUnnecessaryNullabilityAnnotation() throws Exception {
runTest("../../idea/tests/testData/refactoring/extractFunction/basic/unnecessaryNullabilityAnnotation.kt");