Introduce Property: Add tests for default values

This commit is contained in:
Alexey Sedunov
2015-03-05 15:40:04 +03:00
parent 1202e624ce
commit cab301e8e2
5 changed files with 36 additions and 0 deletions
@@ -0,0 +1,4 @@
// EXTRACTION_TARGET: property with initializer
class A(val a: Int = <selection>1 + 2</selection>) {
}
@@ -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) {
}
}
@@ -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");