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 class KotlinFixtureCompletionBaseTestCase : KotlinLightCodeInsightFixtureTestCase() {
|
||||||
abstract fun getPlatform(): TargetPlatform
|
abstract fun getPlatform(): TargetPlatform
|
||||||
|
|
||||||
protected open fun complete(completionType: CompletionType, invocationCount: Int): Array<LookupElement>?
|
protected open fun complete(completionType: CompletionType, invocationCount: Int): Array<LookupElement>? =
|
||||||
= myFixture.complete(completionType, invocationCount)
|
myFixture.complete(completionType, invocationCount)
|
||||||
|
|
||||||
protected abstract fun defaultCompletionType(): CompletionType
|
protected abstract fun defaultCompletionType(): CompletionType
|
||||||
protected open fun defaultInvocationCount(): Int = 0
|
protected open fun defaultInvocationCount(): Int = 0
|
||||||
@@ -41,15 +41,20 @@ abstract class KotlinFixtureCompletionBaseTestCase : KotlinLightCodeInsightFixtu
|
|||||||
val fileText = FileUtil.loadFile(File(testPath), true)
|
val fileText = FileUtil.loadFile(File(testPath), true)
|
||||||
configureCompilerOptions(fileText, project, module)
|
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)) {
|
if (ExpectedCompletionUtils.shouldRunHighlightingBeforeCompletion(fileText)) {
|
||||||
myFixture.doHighlighting()
|
myFixture.doHighlighting()
|
||||||
}
|
}
|
||||||
|
|
||||||
testCompletion(fileText, getPlatform(), { completionType, count -> complete(completionType, count) }, defaultCompletionType(), defaultInvocationCount())
|
testCompletion(
|
||||||
}
|
fileText,
|
||||||
finally {
|
getPlatform(),
|
||||||
|
{ completionType, count -> complete(completionType, count) },
|
||||||
|
defaultCompletionType(),
|
||||||
|
defaultInvocationCount()
|
||||||
|
)
|
||||||
|
} finally {
|
||||||
tearDownFixture()
|
tearDownFixture()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user