FIR IDE: add tests for completion weighers from old testdata
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
// FIR_COMPARISON
|
||||
|
||||
fun shouldCompleteTopLevelCallablesFromIndex() = true
|
||||
|
||||
fun foo(statement: String) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// FIR_COMPARISON
|
||||
|
||||
interface I {
|
||||
fun takeXxx(): Int = 0
|
||||
fun takeYyy(): String = ""
|
||||
|
||||
+9
-3
@@ -28,11 +28,17 @@ abstract class AbstractCompletionWeigherTest(val completionType: CompletionType,
|
||||
val items = InTextDirectivesUtils.findArrayWithPrefixes(text, "// ORDER:")
|
||||
Assert.assertTrue("""Some items should be defined with "// ORDER:" directive""", items.isNotEmpty())
|
||||
|
||||
withCustomCompilerOptions(text, project, module) {
|
||||
myFixture.complete(completionType, InTextDirectivesUtils.getPrefixedInt(text, "// INVOCATION_COUNT:") ?: 1)
|
||||
myFixture.assertPreferredCompletionItems(InTextDirectivesUtils.getPrefixedInt(text, "// SELECTED:") ?: 0, *items)
|
||||
executeTest {
|
||||
withCustomCompilerOptions(text, project, module) {
|
||||
myFixture.complete(completionType, InTextDirectivesUtils.getPrefixedInt(text, "// INVOCATION_COUNT:") ?: 1)
|
||||
myFixture.assertPreferredCompletionItems(InTextDirectivesUtils.getPrefixedInt(text, "// SELECTED:") ?: 0, *items)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open fun executeTest(test: () -> Unit) {
|
||||
test()
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractBasicCompletionWeigherTest() : AbstractCompletionWeigherTest(CompletionType.BASIC, "weighers/basic") {
|
||||
|
||||
Reference in New Issue
Block a user