Created module idea-test-framework and moved classes needed for idea tests there

Moved tests for completion and their test data into module idea-completion
This commit is contained in:
Valentin Kipyatkov
2015-04-13 18:11:53 +03:00
parent 63825c45dd
commit bb808b5620
1303 changed files with 1741 additions and 1733 deletions
@@ -0,0 +1,8 @@
package p1
fun test(s: String, i: Int) {
p2.foo(<caret>)
fun foo(i: Int) = i
// EXIST: s
@@ -0,0 +1,3 @@
package p2
fun foo(s: String) {}
@@ -0,0 +1,15 @@
import p.*
fun foo(): KotlinTrait<I1, I2> {
return <caret>
}
// EXIST: { lookupString: "object", itemText: "object: KotlinTrait<I1, I2>{...}" }
// EXIST: { lookupString: "KotlinInheritor1", itemText: "KotlinInheritor1<I1>", tailText: "() (p)" }
// EXIST: { lookupString: "KotlinInheritor2", itemText: "KotlinInheritor2", tailText: "() (p)" }
// ABSENT: KotlinInheritor3
// EXIST: { lookupString: "object", itemText: "object: KotlinInheritor4<I1, I2>(){...}" }
// ABSENT: KotlinInheritor5
// EXIST: { lookupString: "KotlinInheritor6", itemText: "KotlinInheritor6<I1, Any?, I3>", tailText: "() (p)" }
// EXIST: { lookupString: "JavaInheritor1", itemText: "JavaInheritor1", tailText: "() (<root>)" }
// ABSENT: JavaInheritor2
@@ -0,0 +1,6 @@
import p.*
class JavaInheritor1 implements KotlinTrait<I1, I2>{}
// is not suitable because type arguments do not match
class JavaInheritor2 implements KotlinTrait<I1, I3>{}
@@ -0,0 +1,23 @@
package p
trait I1
trait I2
trait I3
trait KotlinTrait<T1, T2>
open class KotlinInheritor1<T> : KotlinTrait<T, I2>
class KotlinInheritor2 : KotlinInheritor1<I1>()
// is not suitable because type arguments do not match
class KotlinInheritor3 : KotlinInheritor1<Any>()
abstract class KotlinInheritor4<T, V> : KotlinTrait<T, V>
// is not suitable because type arguments do not match
class KotlinInheritor5 : KotlinTrait<Char, I2>
class KotlinInheritor6<T1, T2, T3 : I3> : KotlinTrait<T1, I2>
// ALLOW_AST_ACCESS
@@ -0,0 +1,8 @@
import p.*
fun foo(): KotlinTrait<I1, I1> {
return <caret>
}
// EXIST: { lookupString: "object", itemText: "object: KotlinTrait<I1, I1>{...}" }
// EXIST: { lookupString: "KotlinInheritor", itemText: "KotlinInheritor<I1>", tailText: "() (p)" }
@@ -0,0 +1,11 @@
package p
trait I1
trait I2
trait I3
trait KotlinTrait<T1, T2>
class KotlinInheritor<T> : KotlinTrait<T, T>
// ALLOW_AST_ACCESS
@@ -0,0 +1,8 @@
import p.*
fun foo(): KotlinTrait<I1, I2> {
return <caret>
}
// EXIST: { lookupString: "object", itemText: "object: KotlinTrait<I1, I2>{...}" }
// ABSENT: KotlinInheritor
@@ -0,0 +1,11 @@
package p
trait I1
trait I2
trait I3
trait KotlinTrait<T1, T2>
class KotlinInheritor<T> : KotlinTrait<T, T>
// ALLOW_AST_ACCESS
@@ -0,0 +1,8 @@
import p.*
fun foo(): KotlinTrait<I1<I2>> {
return <caret>
}
// EXIST: { lookupString: "object", itemText: "object: KotlinTrait<I1<I2>>{...}" }
// EXIST: { lookupString: "KotlinInheritor", itemText: "KotlinInheritor<I2>", tailText: "() (p)" }
@@ -0,0 +1,10 @@
package p
trait I1<T>
trait I2
trait KotlinTrait<T>
class KotlinInheritor<T> : KotlinTrait<I1<T>>
// ALLOW_AST_ACCESS
@@ -0,0 +1,5 @@
trait T
class C : A()
// ALLOW_AST_ACCESS
@@ -0,0 +1,11 @@
open class A : T
fun foo(): T {
return <caret>
}
class B : T
// EXIST: A
// EXIST: B
// EXIST: C
@@ -0,0 +1,15 @@
package p1
fun foo(): p2.KotlinTrait {
return <caret>
}
// EXIST: { lookupString: "object", itemText: "object: KotlinTrait{...}" }
// EXIST: { lookupString: "KotlinInheritor1", itemText: "KotlinInheritor1", tailText: "() (p2)" }
// EXIST: { lookupString: "KotlinInheritor2", itemText: "KotlinInheritor2", tailText: "(s: String) (p2)" }
// EXIST: { lookupString: "object", itemText: "object: KotlinInheritor3(){...}" }
// ABSENT: PrivateInheritor
// EXIST: { lookupString: "object", itemText: "object: JavaInheritor1(){...}" }
// EXIST: { lookupString: "JavaInheritor2", itemText: "JavaInheritor2", tailText: "(...) (<root>)" }
// ABSENT: JavaInheritor3
// EXIST: { lookupString: "ObjectInheritor", itemText: "ObjectInheritor", tailText: " (p2)" }
@@ -0,0 +1,16 @@
import p2.KotlinTrait
public abstract class JavaInheritor1 implements KotlinTrait {
}
public class JavaInheritor2 extends JavaInheritor1 {
public JavaInheritor2() {
}
public JavaInheritor2(int p) {
}
}
// not visible - it's package local
class JavaInheritor3 extends KotlinTrait {}
@@ -0,0 +1,17 @@
package p2
trait KotlinTrait
open class KotlinInheritor1 : KotlinTrait
class KotlinInheritor2(s: String) : KotlinInheritor1()
abstract class KotlinInheritor3 : KotlinTrait
class C {
private class PrivateInheritor : KotlinTrait
}
object ObjectInheritor : KotlinTrait
// ALLOW_AST_ACCESS
@@ -0,0 +1,16 @@
class X
class Y
trait T1
trait T2<T>
trait T3<T>
class C1 : T1
class C2<T> : T2<T>, T3<T>
class C3 : T1, T2<X>
fun foo(p: T1){}
fun foo(p: T2<X>){}
fun foo(p: T3<Y>){}
// ALLOW_AST_ACCESS
@@ -0,0 +1,12 @@
fun bar() {
foo(<caret>)
}
// EXIST: { lookupString: "object", itemText: "object: T1{...}" }
// EXIST: { lookupString: "object", itemText: "object: T2<X>{...}" }
// EXIST: { lookupString: "object", itemText: "object: T3<Y>{...}" }
// EXIST: { lookupString: "C1", itemText: "C1" }
// EXIST: { lookupString: "C2", itemText: "C2<X>" }
// EXIST: { lookupString: "C2", itemText: "C2<Y>" }
// EXIST: { lookupString: "C3", itemText: "C3" }
// NUMBER: 7
@@ -0,0 +1,3 @@
class JavaClass {
public static void search(X x) { }
}
@@ -0,0 +1,7 @@
trait X
fun foo(x: X) {
JavaClass.search(<caret>)
}
// EXIST: x
@@ -0,0 +1,5 @@
trait T
object OO : T
// ALLOW_AST_ACCESS
@@ -0,0 +1,6 @@
fun foo(): T = <caret>
// EXIST: foo
// EXIST: { lookupString: "object", itemText: "object: T{...}" }
// EXIST: { lookupString: "OO", itemText: "OO", tailText: " (<root>)" }
// NUMBER: 3