Introduce Property: Add test for name clash in the presence of anonymous initializer (was failing before ElementResolver fix)

This commit is contained in:
Alexey Sedunov
2015-03-04 16:38:57 +03:00
parent a2a47d56fb
commit 79b64c6f9f
3 changed files with 36 additions and 0 deletions
@@ -0,0 +1,14 @@
// EXTRACTION_TARGET: property with initializer
class A {
val i: Int
{
i = 1
}
fun foo(): Int {
return <selection>1 + 2</selection>
}
}
@@ -0,0 +1,16 @@
// EXTRACTION_TARGET: property with initializer
class A {
val i: Int
{
i = 1
}
private val i1 = 1 + 2
fun foo(): Int {
return i1
}
}
@@ -1965,6 +1965,12 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest {
doIntroducePropertyTest(fileName);
}
@TestMetadata("extractToClassWithNameClashAndAnonymousInitializer.kt")
public void testExtractToClassWithNameClashAndAnonymousInitializer() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractToClassWithNameClashAndAnonymousInitializer.kt");
doIntroducePropertyTest(fileName);
}
@TestMetadata("extractToFileWithNameClash.kt")
public void testExtractToFileWithNameClash() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/refactoring/introduceProperty/extractToFileWithNameClash.kt");