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