[mpp, tests] Use JUnit5 in kotlin-project-model tests
This commit is contained in:
@@ -13,13 +13,17 @@ standardPublicJars()
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlinStdlib())
|
implementation(kotlinStdlib())
|
||||||
implementation(project(":kotlin-tooling-core"))
|
implementation(project(":kotlin-tooling-core"))
|
||||||
testFixturesImplementation(kotlin("test-junit"))
|
testApiJUnit5(runner = true)
|
||||||
testFixturesImplementation(project(":kotlin-tooling-core"))
|
testFixturesImplementation(project(":kotlin-tooling-core"))
|
||||||
testFixturesImplementation(project(":core:util.runtime"))
|
testFixturesImplementation(project(":core:util.runtime"))
|
||||||
testFixturesImplementation(projectTests(":generators:test-generator"))
|
testFixturesImplementation(projectTests(":generators:test-generator"))
|
||||||
testFixturesImplementation(project(":kotlin-reflect"))
|
testFixturesImplementation(project(":kotlin-reflect"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
projectTest(jUnitMode = JUnitMode.JUnit5) {
|
||||||
|
useJUnitPlatform()
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType<KotlinJvmCompile>().configureEach {
|
tasks.withType<KotlinJvmCompile>().configureEach {
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
languageVersion = "1.4"
|
languageVersion = "1.4"
|
||||||
|
|||||||
+6
-6
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.project.model
|
package org.jetbrains.kotlin.project.model
|
||||||
|
|
||||||
import org.junit.Assume.assumeTrue
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.Test
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import kotlin.test.assertEquals
|
import org.junit.jupiter.api.Assumptions.assumeTrue
|
||||||
import kotlin.test.assertTrue
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
internal class DefaultModuleFragmentsResolverTest {
|
internal class DefaultModuleFragmentsResolverTest {
|
||||||
val bundleFoo = simpleModuleBundle("foo")
|
val bundleFoo = simpleModuleBundle("foo")
|
||||||
@@ -34,7 +34,7 @@ internal class DefaultModuleFragmentsResolverTest {
|
|||||||
val result = fragmentResolver.getChosenFragments(consumingFragment, moduleFooMain)
|
val result = fragmentResolver.getChosenFragments(consumingFragment, moduleFooMain)
|
||||||
assertTrue(result is KpmFragmentResolution.ChosenFragments)
|
assertTrue(result is KpmFragmentResolution.ChosenFragments)
|
||||||
val expected = expectedVisibleFragments.getValue(consumingFragment.fragmentName)
|
val expected = expectedVisibleFragments.getValue(consumingFragment.fragmentName)
|
||||||
assertEquals(expected, result.visibleFragments.map { it.fragmentName }.toSet())
|
assertEquals(expected, (result as KpmFragmentResolution.ChosenFragments).visibleFragments.map { it.fragmentName }.toSet())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ internal class DefaultModuleFragmentsResolverTest {
|
|||||||
val (commonMainResult, jsAndLinuxResult) = listOf("common", "jsAndLinux").map {
|
val (commonMainResult, jsAndLinuxResult) = listOf("common", "jsAndLinux").map {
|
||||||
val chosenFragments = fragmentResolver.getChosenFragments(dependingModule.fragment(it), moduleFooMain)
|
val chosenFragments = fragmentResolver.getChosenFragments(dependingModule.fragment(it), moduleFooMain)
|
||||||
assertTrue(chosenFragments is KpmFragmentResolution.ChosenFragments)
|
assertTrue(chosenFragments is KpmFragmentResolution.ChosenFragments)
|
||||||
chosenFragments.visibleFragments.map { it.fragmentName }.toSet()
|
(chosenFragments as KpmFragmentResolution.ChosenFragments).visibleFragments.map { it.fragmentName }.toSet()
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(setOf("common", "jvmAndJs"), commonMainResult)
|
assertEquals(setOf("common", "jvmAndJs"), commonMainResult)
|
||||||
|
|||||||
Reference in New Issue
Block a user