Shorten references tests for typealias.

This commit is contained in:
Dmitry Petrov
2016-06-15 17:50:15 +03:00
parent 075195a3e4
commit 0033cf85c4
9 changed files with 85 additions and 0 deletions
@@ -0,0 +1,7 @@
package test
class WithCtor(val x: Int)
typealias Alias = WithCtor
val x = <selection>test.Alias(1)</selection>
@@ -0,0 +1,7 @@
package test
class WithCtor(val x: Int)
typealias Alias = WithCtor
val x = Alias(1)
@@ -0,0 +1,9 @@
package test
class WithCompanion {
companion object
}
typealias Alias = WithCompanion
val x = <selection>test.Alias</selection>
@@ -0,0 +1,9 @@
package test
class WithCompanion {
companion object
}
typealias Alias = WithCompanion
val x = Alias
@@ -0,0 +1,5 @@
package test
typealias Str = String
val s: <selection>test.Str</selection> = ""
@@ -0,0 +1,5 @@
package test
typealias Str = String
val s: Str = ""
@@ -0,0 +1,5 @@
package test
typealias Str = String
fun foo(s: <selection>List<test.Str></selection>) {}
@@ -0,0 +1,5 @@
package test
typealias Str = String
fun foo(s: List<Str>) {}
@@ -469,4 +469,37 @@ public class ShortenRefsTestGenerated extends AbstractShortenRefsTest {
doTest(fileName);
}
}
@TestMetadata("idea/testData/shortenRefs/typealias")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Typealias extends AbstractShortenRefsTest {
public void testAllFilesPresentInTypealias() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/shortenRefs/typealias"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
}
@TestMetadata("TypeAliasAsCtor.kt")
public void testTypeAliasAsCtor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/shortenRefs/typealias/TypeAliasAsCtor.kt");
doTest(fileName);
}
@TestMetadata("TypeAliasAsObject.kt")
public void testTypeAliasAsObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/shortenRefs/typealias/TypeAliasAsObject.kt");
doTest(fileName);
}
@TestMetadata("TypeAliasAsType.kt")
public void testTypeAliasAsType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/shortenRefs/typealias/TypeAliasAsType.kt");
doTest(fileName);
}
@TestMetadata("TypeAliasAsTypeArgument.kt")
public void testTypeAliasAsTypeArgument() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/shortenRefs/typealias/TypeAliasAsTypeArgument.kt");
doTest(fileName);
}
}
}