Add test lookup tracking for local declarations

Original commit: 3465126bee
This commit is contained in:
Zalim Bashorov
2015-08-20 17:16:13 +03:00
parent 4032df4960
commit 7a7064677b
3 changed files with 56 additions and 0 deletions
@@ -41,6 +41,12 @@ public class LookupTrackerTestGenerated extends AbstractLookupTrackerTest {
doTest(fileName);
}
@TestMetadata("localDeclarations")
public void testLocalDeclarations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/lookupTracker/localDeclarations/");
doTest(fileName);
}
@TestMetadata("packageDeclarations")
public void testPackageDeclarations() throws Exception {
String fileName = JetTestUtils.navigationMetadata("jps-plugin/testData/incremental/lookupTracker/packageDeclarations/");
@@ -0,0 +1 @@
package bar
@@ -0,0 +1,49 @@
package local.declarations
import bar.*
/*p:local.declarations*/fun f(p: /*p:local.declarations*/Any) {
p.toString()
val a = 1
val b = a
fun localFun() = b
fun /*p:local.declarations*/Int.localExtFun() = /*p:local.declarations p:bar*/localFun()
interface LocalI {
var a: /*p:local.declarations*/Int
fun foo()
}
class LocalC : LocalI {
override var a = 1
override fun foo() {}
var b = "bbb"
fun bar() = b
}
val o = object {
val a = "aaa"
fun foo(): LocalI = null as LocalI
}
/*p:local.declarations p:bar*/localFun()
1./*p:local.declarations p:bar*/localExtFun()
val c = /*p:local.declarations p:bar*/LocalC()
c.a
c.b
c.foo()
c.bar()
val i: LocalI = c
i.a
i.foo()
o.a
val ii = o.foo()
ii.a
}