Introduce Property: Add tests for default values
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
class A(val a: Int = <selection>1 + 2</selection>) {
|
||||
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
private val i = 1 + 2
|
||||
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
class A(val a: Int = i) {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
class A {
|
||||
fun foo(a: Int = <selection>1 + 2</selection>) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// EXTRACTION_TARGET: property with initializer
|
||||
class A {
|
||||
private val i = 1 + 2
|
||||
|
||||
fun foo(a: Int = i) {
|
||||
|
||||
}
|
||||
}
|
||||
+12
@@ -1935,6 +1935,18 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/refactoring/introduceProperty"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("extractFromDefaultValueInConstructor.kt")
|
||||
public void testExtractFromDefaultValueInConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractFromDefaultValueInConstructor.kt");
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractFromDefaultValueInFun.kt")
|
||||
public void testExtractFromDefaultValueInFun() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractFromDefaultValueInFun.kt");
|
||||
doIntroducePropertyTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("extractLazyMultipleExpressions.kt")
|
||||
public void testExtractLazyMultipleExpressions() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractLazyMultipleExpressions.kt");
|
||||
|
||||
Reference in New Issue
Block a user