Minor: reformat and clean-up KotlinFixtureCompletionBaseTestCase

This commit is contained in:
Dmitry Savvinov
2018-07-26 13:00:21 +03:00
parent 099fc0ad51
commit 2a57807c85
@@ -28,8 +28,8 @@ import java.io.File
abstract class KotlinFixtureCompletionBaseTestCase : KotlinLightCodeInsightFixtureTestCase() {
abstract fun getPlatform(): TargetPlatform
protected open fun complete(completionType: CompletionType, invocationCount: Int): Array<LookupElement>?
= myFixture.complete(completionType, invocationCount)
protected open fun complete(completionType: CompletionType, invocationCount: Int): Array<LookupElement>? =
myFixture.complete(completionType, invocationCount)
protected abstract fun defaultCompletionType(): CompletionType
protected open fun defaultInvocationCount(): Int = 0
@@ -41,15 +41,20 @@ abstract class KotlinFixtureCompletionBaseTestCase : KotlinLightCodeInsightFixtu
val fileText = FileUtil.loadFile(File(testPath), true)
configureCompilerOptions(fileText, project, module)
assertTrue("\"<caret>\" is missing in file \"$testPath\"", fileText.contains("<caret>"));
assertTrue("\"<caret>\" is missing in file \"$testPath\"", fileText.contains("<caret>"))
if (ExpectedCompletionUtils.shouldRunHighlightingBeforeCompletion(fileText)) {
myFixture.doHighlighting()
}
testCompletion(fileText, getPlatform(), { completionType, count -> complete(completionType, count) }, defaultCompletionType(), defaultInvocationCount())
}
finally {
testCompletion(
fileText,
getPlatform(),
{ completionType, count -> complete(completionType, count) },
defaultCompletionType(),
defaultInvocationCount()
)
} finally {
tearDownFixture()
}
}