[MPP][Test] Enable 'FIR_IDENTICAL' default directive for AbstractDiagnosticsWithMultiplatformCompositeAnalysisTest
^KT-50120
This commit is contained in:
committed by
Space
parent
bd303007f8
commit
3d4439a2dc
-21
@@ -1,21 +0,0 @@
|
|||||||
// MODULE: m1-common
|
|
||||||
// FILE: common.kt
|
|
||||||
|
|
||||||
expect class Ok(x: Int, y: String = "")
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
Ok(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
|
||||||
Ok(42)
|
|
||||||
Ok(42, "OK")
|
|
||||||
}
|
|
||||||
|
|
||||||
// MODULE: m2-jvm()()(m1-common)
|
|
||||||
// FILE: jvm.kt
|
|
||||||
|
|
||||||
actual class Ok actual constructor(x: Int, y: String)
|
|
||||||
|
|
||||||
fun testJvm() {
|
|
||||||
Ok(<!NO_VALUE_FOR_PARAMETER!>)<!>
|
|
||||||
Ok(42)
|
|
||||||
Ok(42, "OK")
|
|
||||||
}
|
|
||||||
-73
@@ -1,73 +0,0 @@
|
|||||||
// MODULE: m1-common
|
|
||||||
// FILE: common.kt
|
|
||||||
|
|
||||||
import A.Companion.companionExtensionFunction
|
|
||||||
|
|
||||||
expect class A() {
|
|
||||||
fun memberFunction(x: Int, y: String = "ok")
|
|
||||||
companion object {
|
|
||||||
fun companionFunction(x: Int, y: String = "ok")
|
|
||||||
fun String.companionExtensionFunction(x: Int, y: String = "ok")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
expect fun topLevelFunction(x: Int, y: String = "ok")
|
|
||||||
|
|
||||||
expect fun String.topLevelExtensionFunction(x: Int, y: String = "ok")
|
|
||||||
|
|
||||||
fun test() {
|
|
||||||
A().memberFunction()
|
|
||||||
A().memberFunction(42)
|
|
||||||
A().memberFunction(42, "ok")
|
|
||||||
|
|
||||||
topLevelFunction()
|
|
||||||
topLevelFunction(42)
|
|
||||||
topLevelFunction(42, "ok")
|
|
||||||
|
|
||||||
"".topLevelExtensionFunction()
|
|
||||||
"".topLevelExtensionFunction(42)
|
|
||||||
"".topLevelExtensionFunction(42, "ok")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun A.test() {
|
|
||||||
"".companionExtensionFunction()
|
|
||||||
"".companionExtensionFunction(42)
|
|
||||||
"".companionExtensionFunction(42, "ok")
|
|
||||||
}
|
|
||||||
|
|
||||||
// MODULE: m2-jvm()()(m1-common)
|
|
||||||
// FILE: jvm.kt
|
|
||||||
|
|
||||||
import A.Companion.companionExtensionFunction
|
|
||||||
|
|
||||||
actual class A {
|
|
||||||
actual fun memberFunction(x: Int, y: String) = Unit
|
|
||||||
actual companion object {
|
|
||||||
actual fun companionFunction(x: Int, y: String) = Unit
|
|
||||||
actual fun String.companionExtensionFunction(x: Int, y: String) = Unit
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
actual fun topLevelFunction(x: Int, y: String) = Unit
|
|
||||||
|
|
||||||
actual fun String.topLevelExtensionFunction(x: Int, y: String) = Unit
|
|
||||||
|
|
||||||
fun testJvm() {
|
|
||||||
A().memberFunction()
|
|
||||||
A().memberFunction(42)
|
|
||||||
A().memberFunction(42, "ok")
|
|
||||||
|
|
||||||
topLevelFunction()
|
|
||||||
topLevelFunction(42)
|
|
||||||
topLevelFunction(42, "ok")
|
|
||||||
|
|
||||||
"".topLevelExtensionFunction()
|
|
||||||
"".topLevelExtensionFunction(42)
|
|
||||||
"".topLevelExtensionFunction(42, "ok")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun A.testJvm() {
|
|
||||||
"".companionExtensionFunction()
|
|
||||||
"".companionExtensionFunction(42)
|
|
||||||
"".companionExtensionFunction(42, "ok")
|
|
||||||
}
|
|
||||||
+3
-3
@@ -7,18 +7,18 @@ package org.jetbrains.kotlin.test.runners
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder
|
||||||
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.SKIP_TXT
|
import org.jetbrains.kotlin.test.directives.DiagnosticsDirectives.SKIP_TXT
|
||||||
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives
|
import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives.FIR_IDENTICAL
|
||||||
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.LANGUAGE
|
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.LANGUAGE
|
||||||
import org.jetbrains.kotlin.test.directives.MultiplatformDiagnosticsDirectives
|
|
||||||
import org.jetbrains.kotlin.test.directives.MultiplatformDiagnosticsDirectives.MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE_ENABLED
|
import org.jetbrains.kotlin.test.directives.MultiplatformDiagnosticsDirectives.MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE_ENABLED
|
||||||
|
|
||||||
abstract class AbstractDiagnosticsWithMultiplatformCompositeAnalysisTest : AbstractDiagnosticTest() {
|
abstract class AbstractDiagnosticsWithMultiplatformCompositeAnalysisTest : AbstractDiagnosticTest() {
|
||||||
override fun configure(builder: TestConfigurationBuilder) {
|
override fun configure(builder: TestConfigurationBuilder) {
|
||||||
super.configure(builder)
|
super.configure(builder)
|
||||||
builder.defaultDirectives {
|
builder.defaultDirectives {
|
||||||
|
LANGUAGE with "+MultiPlatformProjects"
|
||||||
+MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE_ENABLED
|
+MULTIPLATFORM_COMPOSITE_ANALYSIS_MODE_ENABLED
|
||||||
+SKIP_TXT
|
+SKIP_TXT
|
||||||
LANGUAGE with "+MultiPlatformProjects"
|
+FIR_IDENTICAL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user