Fix completion handler tests: use tail specifier to select one of multiple completion variants (eg 'kotlin.collections.ArrayList' vs 'java.util.ArrayList').

Replace aliased types imported by default with something else.
This commit is contained in:
Ilya Gorbunov
2016-10-06 23:07:49 +03:00
parent a62cda8365
commit e787930673
13 changed files with 28 additions and 25 deletions
@@ -1,2 +1,3 @@
// RUNTIME
fun Str<caret>foo() {
}
@@ -1,2 +1,3 @@
// RUNTIME
fun StringBuilder<caret>foo() {
}
@@ -1,2 +1,3 @@
// RUNTIME
fun foo(p: StringB<caret>) {
}
@@ -1,2 +1,3 @@
// RUNTIME
fun foo(p: StringBuilder<caret>) {
}
@@ -2,4 +2,5 @@ class Foo<T, V>
class Bar: Foo<S<caret>
// ELEMENT: StringBuilder
// ELEMENT: StringBuilder
// TAIL_TEXT: " (kotlin.text)"
@@ -1,5 +1,6 @@
class Foo<T, V>
class Bar: Foo<StringBuilder<caret>
class Bar: Foo<StringBuilder
// ELEMENT: StringBuilder
// ELEMENT: StringBuilder
// TAIL_TEXT: " (kotlin.text)"
@@ -1,7 +1,6 @@
import java.util.HashMap
fun foo() {
val v = HashMap<String, H<caret>
}
// ELEMENT: HashSet
// ELEMENT: HashSet
// TAIL_TEXT: "<E> (kotlin.collections)"
@@ -1,8 +1,6 @@
import java.util.HashMap
import java.util.HashSet
fun foo() {
val v = HashMap<String, HashSet<caret>
val v = HashMap<String, HashSet
}
// ELEMENT: HashSet
// ELEMENT: HashSet
// TAIL_TEXT: "<E> (kotlin.collections)"
@@ -1,9 +1,9 @@
class X<T> {
fun foo(p: java.util.HashMap<java.io.File, T>){}
fun foo(p: java.util.TreeMap<java.io.File, T>){}
fun f(){
foo(<caret>)
}
}
// ELEMENT: HashMap
// ELEMENT: TreeMap
@@ -1,11 +1,11 @@
import java.util.HashMap
import java.util.TreeMap
class X<T> {
fun foo(p: java.util.HashMap<java.io.File, T>){}
fun foo(p: java.util.TreeMap<java.io.File, T>){}
fun f(){
foo(HashMap(<caret>))
foo(TreeMap())
}
}
// ELEMENT: HashMap
// ELEMENT: TreeMap
@@ -1,9 +1,9 @@
class X<T> {
fun foo(p: java.util.HashMap<T, java.util.AbstractMap<T, java.io.File>>){}
fun foo(p: java.util.TreeMap<T, java.util.AbstractMap<T, java.io.File>>){}
fun f(){
foo(<caret>)
}
}
// ELEMENT: HashMap
// ELEMENT: TreeMap
@@ -1,11 +1,11 @@
import java.util.HashMap
import java.util.TreeMap
class X<T> {
fun foo(p: java.util.HashMap<T, java.util.AbstractMap<T, java.io.File>>){}
fun foo(p: java.util.TreeMap<T, java.util.AbstractMap<T, java.io.File>>){}
fun f(){
foo(HashMap(<caret>))
foo(TreeMap())
}
}
// ELEMENT: HashMap
// ELEMENT: TreeMap
@@ -49,7 +49,7 @@ import java.io.File
fun testClassCompletionInLambda() = doTest(1, "String", " (kotlin)", '\n')
fun testClassCompletionBeforeName() = doTest(1, "StringBuilder", " (java.lang)", '\n')
fun testClassCompletionBeforeName() = doTest(1, "StringBuilder", " (kotlin.text)", '\n')
fun testDoNotInsertImportForAlreadyImported() = doTest()
@@ -129,7 +129,7 @@ import java.io.File
fun testClassFromClassObject() = doTest(1, "Some", null, '\n')
fun testClassFromClassObjectInPackage() = doTest(1, "Some", null, '\n')
fun testParameterType() = doTest(1, "StringBuilder", " (java.lang)", '\n')
fun testParameterType() = doTest(1, "StringBuilder", " (kotlin.text)", '\n')
fun testLocalClassCompletion() = doTest(1, "LocalClass", null, '\n')
fun testNestedLocalClassCompletion() = doTest(1, "Nested", null, '\n')