[kotlin] k2: additional testdata for extract function

^KTIJ-9144 fixed

GitOrigin-RevId: 0c100bcc220db2dcfda0190b887ae8924232d83f
This commit is contained in:
Anna Kozlova
2024-03-27 19:29:58 +00:00
committed by intellij-monorepo-bot
parent da942eb388
commit e0b71eb287
4 changed files with 30 additions and 0 deletions
@@ -1444,6 +1444,11 @@ public abstract class ExtractionTestGenerated extends AbstractExtractionTest {
runTest("testData/refactoring/extractFunction/controlFlow/outputValues/nestedNonInlinableCall.kt");
}
@TestMetadata("outputValueByNullability.kt")
public void testOutputValueByNullability() throws Exception {
runTest("testData/refactoring/extractFunction/controlFlow/outputValues/outputValueByNullability.kt");
}
@TestMetadata("outputValueWithExpression.kt")
public void testOutputValueWithExpression() throws Exception {
runTest("testData/refactoring/extractFunction/controlFlow/outputValues/outputValueWithExpression.kt");
@@ -0,0 +1,8 @@
fun test(): String? {
<selection>arrayOf(1, 2, 3).forEach {
return ""
}
return null</selection>
}
// IGNORE_K1
@@ -0,0 +1,12 @@
fun test(): String? {
return string()
}
private fun string(): String? {
arrayOf(1, 2, 3).forEach {
return ""
}
return null
}
// IGNORE_K1
@@ -665,6 +665,11 @@ public abstract class K2IntroduceFunctionTestGenerated extends AbstractK2Introdu
runTest("../../idea/tests/testData/refactoring/extractFunction/controlFlow/outputValues/nestedNonInlinableCall.kt");
}
@TestMetadata("outputValueByNullability.kt")
public void testOutputValueByNullability() throws Exception {
runTest("../../idea/tests/testData/refactoring/extractFunction/controlFlow/outputValues/outputValueByNullability.kt");
}
@TestMetadata("outputValueWithExpression.kt")
public void testOutputValueWithExpression() throws Exception {
runTest("../../idea/tests/testData/refactoring/extractFunction/controlFlow/outputValues/outputValueWithExpression.kt");