Minor: reformat and clean-up KotlinFixtureCompletionBaseTestCase
This commit is contained in:
+11
-6
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user