Refactoring: introduce doTest in MultiModuleLineMarkerTest
This commit is contained in:
@@ -20,39 +20,35 @@ import org.jetbrains.kotlin.config.JvmTarget
|
|||||||
import org.jetbrains.kotlin.config.TargetPlatformKind
|
import org.jetbrains.kotlin.config.TargetPlatformKind
|
||||||
|
|
||||||
class MultiModuleLineMarkerTest : AbstractMultiModuleLineMarkerTest() {
|
class MultiModuleLineMarkerTest : AbstractMultiModuleLineMarkerTest() {
|
||||||
fun testFromCommonToJvmHeader() {
|
|
||||||
|
private fun doTest(vararg platforms: TargetPlatformKind<*>) {
|
||||||
val header = module("header")
|
val header = module("header")
|
||||||
header.createFacet(TargetPlatformKind.Common)
|
header.createFacet(TargetPlatformKind.Common)
|
||||||
|
|
||||||
val jvm = module("jvm")
|
for (platform in platforms) {
|
||||||
jvm.createFacet(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
val path = when (platform) {
|
||||||
jvm.enableMultiPlatform()
|
is TargetPlatformKind.Jvm -> "jvm"
|
||||||
jvm.addDependency(header)
|
is TargetPlatformKind.JavaScript -> "js"
|
||||||
|
else -> error("Unsupported platform: $platform")
|
||||||
|
}
|
||||||
|
val platformModule = module(path)
|
||||||
|
platformModule.createFacet(platform)
|
||||||
|
platformModule.enableMultiPlatform()
|
||||||
|
platformModule.addDependency(header)
|
||||||
|
}
|
||||||
|
|
||||||
checkHighlightingInAllFiles()
|
checkHighlightingInAllFiles()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun testFromCommonToJvmHeader() {
|
||||||
|
doTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
||||||
|
}
|
||||||
|
|
||||||
fun testFromCommonToJvmImpl() {
|
fun testFromCommonToJvmImpl() {
|
||||||
val header = module("header")
|
doTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
||||||
header.createFacet(TargetPlatformKind.Common)
|
|
||||||
|
|
||||||
val jvm = module("jvm")
|
|
||||||
jvm.createFacet(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
|
||||||
jvm.enableMultiPlatform()
|
|
||||||
jvm.addDependency(header)
|
|
||||||
|
|
||||||
checkHighlightingInAllFiles()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun testFromClassToAlias() {
|
fun testFromClassToAlias() {
|
||||||
val header = module("header")
|
doTest(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
||||||
header.createFacet(TargetPlatformKind.Common)
|
|
||||||
|
|
||||||
val jvm = module("jvm")
|
|
||||||
jvm.createFacet(TargetPlatformKind.Jvm[JvmTarget.JVM_1_6])
|
|
||||||
jvm.enableMultiPlatform()
|
|
||||||
jvm.addDependency(header)
|
|
||||||
|
|
||||||
checkHighlightingInAllFiles()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user