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,11 @@
fun String?.forNullableString(){}
fun Any?.forNullableAny(){}
fun String.forString(){}
fun foo(s: String?) {
s.for<caret>
}
// ORDER: forNullableString
// ORDER: forNullableAny
// ORDER: forString
@@ -0,0 +1,38 @@
fun aaGlobalFun(){}
val aaGlobalProp = 1
open class Base {
fun aaBaseFun(){}
val aaBaseProp = 1
}
class Derived : Base() {
fun aaDerivedFun(){}
val aaDerivedProp = 1
fun foo() {
val aaLocalVal = 1
fun aaLocalFun(){}
aa<caret>
}
}
fun Any.aAnyExtensionFun(){}
fun Derived.aaExtensionFun(){}
val Any.aAnyExtensionProp: Int get() = 1
val Derived.aaExtensionProp: Int get() = 1
// ORDER: aaLocalVal
// ORDER: aaLocalFun
// ORDER: aaDerivedProp
// ORDER: aaDerivedFun
// ORDER: aaBaseProp
// ORDER: aaBaseFun
// ORDER: aaExtensionProp
// ORDER: aaExtensionFun
// ORDER: aAnyExtensionProp
// ORDER: aAnyExtensionFun
// ORDER: aaGlobalProp
// ORDER: aaGlobalFun
@@ -0,0 +1,9 @@
fun foo1() {}
deprecated("Use foo3 instead") fun foo2() {}
fun foo3() {}
fun test() {
foo<caret>
}
// ORDER: foo1, foo3, foo2
@@ -0,0 +1,10 @@
fun test() {
val ifMore = true
val isFirst = true
if<caret>
}
// ORDER: if
// ORDER: ifMore
// ORDER: isFirst
// SELECTED: 0
@@ -0,0 +1,9 @@
package ppp
fun prefixFun1(){}
fun prefixFun2(){}
fun prefixFun3(){}
val prefixProp1: Int = 1
val prefixProp2: Int = 1
val prefixProp3: Int = 1
@@ -0,0 +1,12 @@
import ppp.prefixFun2
import ppp.prefixProp2
val some = prefix<caret>
// INVOCATION_COUNT: 2
// ORDER: prefixProp2
// ORDER: prefixProp1
// ORDER: prefixProp3
// ORDER: prefixFun2
// ORDER: prefixFun1
// ORDER: prefixFun3
@@ -0,0 +1,8 @@
import java.sql.DriverPropertyInfo
val some = Driver<caret>
// INVOCATION_COUNT: 2
// ORDER: Driver
// ORDER: DriverPropertyInfo
// ORDER: DriverManager
@@ -0,0 +1,4 @@
package ppp1
class MyClass1
class MyClass2
@@ -0,0 +1,4 @@
package ppp2
class MyClass3
class MyClass4
@@ -0,0 +1,4 @@
package ppp3
class MyClass5
class MyClass6
@@ -0,0 +1,24 @@
import ppp1.*
import ppp3.MyClass6
val v = My<caret>
// INVOCATION_COUNT: 2
/* explicitly imported */
// ORDER: MyClass6
/* imported with * */
// ORDER: MyClass1
/* imported with * */
// ORDER: MyClass2
/* another class from the same package imported */
// ORDER: MyClass5
/* not imported */
// ORDER: MyClass3
/* not imported */
// ORDER: MyClass4
@@ -0,0 +1,6 @@
fun main(variables: Array<String>) {
val values = ""
va<caret>
}
// ORDER: values, val, variables, var
@@ -0,0 +1,5 @@
package some
fun foo() = 12
fun fooImported() = 12
fun fooNotImported() = 12
@@ -0,0 +1,12 @@
import some.fooImported
val fooVar = 12
fun fooLocal() = 12
val some = foo<caret>
// "foo" is before other elements because of exact prefix match
// ORDER: foo, fooVar, fooLocal, fooImported, fooNotImported
// INVOCATION_COUNT: 2
// SELECTED: 0
@@ -0,0 +1,8 @@
val initGlobal = 12
fun test(initParam : Int) {
val initLocal = "Test"
init<caret>
}
// ORDER: initLocal, initParam, initGlobal
@@ -0,0 +1,6 @@
fun test() {
val r = 12
r<caret>
}
// ORDER: r, return
@@ -0,0 +1,6 @@
fun test(fals: Int) {
val falt = 111
fa<caret>
}
// ORDER: fals, falt, false
@@ -0,0 +1,10 @@
package temp.test
class Options(val listNew: Boolean, val listMatch: Boolean) {
}
fun listImportedFun() = 12
val listImportedVal = 11
@@ -0,0 +1,22 @@
package test
import temp.test.*
val listThisFileVal = 12
fun listThisFileFun() = 1
class ListThisFileClass {}
fun test(listParam: Int) {
val listLocalVal = 12
Options(list<caret>)
}
// ORDER: listLocalVal
// ORDER: listParam
// ORDER: listThisFileVal
// ORDER: listImportedVal
// ORDER: listThisFileFun
// ORDER: listImportedFun
// ORDER: listMatch
// ORDER: listNew
@@ -0,0 +1,5 @@
fun bar(fop: Int) {
fo<caret>
}
// ORDER: fop, for
@@ -0,0 +1,21 @@
val br1 = 11
fun br() = 111
class Test(val br2 = 12) {
val br3 = 13
fun brf() = 112
fun test(br4: Int) {
while (true) {
val br5 = 14
br<caret>
}
}
}
// "br" function is before other elements because of exact prefix match
// ORDER: br, br4, br5, br2, br3, brf, br1, break
// SELECTED: 0