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,12 @@
package Test
class Some() {
fun methodName() {
<caret>
}
}
fun Some.first() {
}
// EXIST: first
@@ -0,0 +1,10 @@
class Some() {
fun methodName() {
this.<caret>
}
}
fun Some.first() {
}
// EXIST: first
@@ -0,0 +1,11 @@
fun Some.first() {
}
class Some() {
}
fun Some.second() {
<caret>
}
// EXIST: first, second
@@ -0,0 +1,11 @@
fun Some.first() {
}
class Some() {
}
fun Some.second() {
this.<caret>
}
// EXIST: first, second
@@ -0,0 +1,11 @@
package foo
object A
fun A.foo() {}
fun some() {
foo.A.<caret>
}
// EXIST: foo
@@ -0,0 +1,15 @@
package foo
class A {
class B {
companion object
}
}
fun A.B.Companion.foo() {}
fun some() {
A.B.<caret>
}
// EXIST: foo
@@ -0,0 +1,21 @@
package a.b
class Some {
inner class Inner {
fun foo() {
"".<caret>
}
fun String.memberExtFun() { }
}
val String.memberExtProp: Int get() = 1
}
fun String.extFun() { }
val String.extProp: Int get() = 1
// EXIST: { lookupString: "extFun", itemText: "extFun", tailText: "() for String in a.b", typeText: "Unit" }
// EXIST: { lookupString: "extProp", itemText: "extProp", tailText: " for String in a.b", typeText: "Int" }
// EXIST: { lookupString: "memberExtFun", itemText: "memberExtFun", tailText: "() for String in Some.Inner", typeText: "Unit" }
// EXIST: { lookupString: "memberExtProp", itemText: "memberExtProp", tailText: " for String in Some", typeText: "Int" }
@@ -0,0 +1,17 @@
class SomeObject<T, U>() {
var field : T? = null
}
class A {}
class C {}
fun <T: Comparable<T>, U> SomeObject<T, U>.compareTo(other : SomeObject<T, U>) : Int {
return 0;
}
fun some() {
val test = SomeObject<A, A>
test.<caret>
}
// ABSENT: compareTo
@@ -0,0 +1,11 @@
fun Some.simpleKotlinExtension() {
}
class Some() {
}
fun test() {
<caret>
}
// ABSENT: simpleKotlinExtension
@@ -0,0 +1,10 @@
fun <T> Iterable<T>.first() : T? {
return this.iterator()?.next()
}
fun main(args : Array<String>) {
val test = java.util.HashSet<Int>()
test.<caret>
}
// EXIST: first
@@ -0,0 +1,12 @@
fun <T> Some<T>.close() {
}
class Some<T>() {
}
fun test() {
val s = Some<String>()
s.<caret>
}
// EXIST: close
@@ -0,0 +1,12 @@
fun Some.simpleKotlinExtension() {
}
class Some() {
}
fun test() {
val s = Some()
s.<caret>
}
// EXIST: simpleKotlinExtension
@@ -0,0 +1,11 @@
class X {
fun String.f() {}
}
fun fn() {
with (X()) {
"sss".<caret>
}
}
// EXIST: f
@@ -0,0 +1,20 @@
class C {
fun String.extFun() {
<caret>
}
fun String.otherExtFun() { }
fun Int.wrongExtFun() { }
companion object {
fun String.companionExtFun() { }
}
}
fun String.nonMemberExtFun() {}
// EXIST: extFun
// EXIST: otherExtFun
// ABSENT: wrongExtFun
// EXIST: nonMemberExtFun
// EXIST: companionExtFun
@@ -0,0 +1,18 @@
trait A {
fun foo(): Int
}
trait B: A {
override fun foo(): Int
override fun foo1(): Int
}
fun g(a: A) {
if (a is B) {
a.fo<caret>
}
}
// EXIST: foo
// EXIST: foo1
// NUMBER: 2
@@ -0,0 +1,11 @@
class C {
fun String.memberExtForString(){}
companion object {
fun foo() {
"".<caret>
}
}
}
// ABSENT: memberExtForString
@@ -0,0 +1,14 @@
class C {
fun String.extFun() { }
companion object {
fun String.foo() {
<caret>
}
}
}
fun String.nonMemberExtFun() {}
// EXIST: nonMemberExtFun
// ABSENT: extFun
@@ -0,0 +1,10 @@
class Foo {
fun Int.bar() = this
}
fun main(args: Array<String>) {
val v = Foo()
v.<caret>
}
// ABSENT: bar
@@ -0,0 +1,11 @@
class X {
fun String.f() {}
}
fun foo() {
with (X()) {
<caret>
}
}
// ABSENT: f