diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-30 15:58:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-30 15:58:46 +0200 |
commit | c63ea36637ce956029fb15b1482c0683ecb8a587 (patch) | |
tree | 2b75a8a976b43530820e73dc60cce4b10d9fc005 /plugins/gfm | |
parent | 0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 (diff) | |
download | dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.gz dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.tar.bz2 dokka-c63ea36637ce956029fb15b1482c0683ecb8a587.zip |
Migrate to JUnit 5 and unify used test API (#3138)
Diffstat (limited to 'plugins/gfm')
7 files changed, 33 insertions, 32 deletions
diff --git a/plugins/gfm/build.gradle.kts b/plugins/gfm/build.gradle.kts index b7e6fc18..c238965a 100644 --- a/plugins/gfm/build.gradle.kts +++ b/plugins/gfm/build.gradle.kts @@ -18,11 +18,10 @@ dependencies { } } + testImplementation(kotlin("test")) testImplementation(projects.plugins.base) testImplementation(projects.plugins.base.baseTestUtils) testImplementation(projects.core.testApi) - testImplementation(platform(libs.junit.bom)) - testImplementation(libs.junit.jupiter) } registerDokkaArtifactPublication("gfmPlugin") { diff --git a/plugins/gfm/gfm-template-processing/build.gradle.kts b/plugins/gfm/gfm-template-processing/build.gradle.kts index 9611a8aa..12c95a08 100644 --- a/plugins/gfm/gfm-template-processing/build.gradle.kts +++ b/plugins/gfm/gfm-template-processing/build.gradle.kts @@ -16,9 +16,8 @@ dependencies { implementation(kotlin("reflect")) implementation(libs.kotlinx.coroutines.core) + testImplementation(kotlin("test")) testImplementation(projects.core.testApi) - testImplementation(platform(libs.junit.bom)) - testImplementation(libs.junit.jupiter) } registerDokkaArtifactPublication("dokkaGfmTemplateProcessing") { diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/CodeWrappingTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/CodeWrappingTest.kt index ae40694c..676e263b 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/CodeWrappingTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/CodeWrappingTest.kt @@ -1,8 +1,8 @@ package renderers.gfm import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer -import org.junit.jupiter.api.Test import renderers.testPage +import kotlin.test.Test import kotlin.test.assertEquals class CodeWrappingTest : GfmRenderingOnlyTestBase() { diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt index ae1b4d7f..32491154 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt @@ -5,10 +5,11 @@ import org.jetbrains.dokka.Platform import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup -import org.junit.jupiter.api.Test import renderers.testPage import testApi.testRunner.defaultSourceSet import java.io.File +import kotlin.test.Test +import kotlin.test.assertEquals class DivergentTest : GfmRenderingOnlyTestBase() { private val js = defaultSourceSet.copy( @@ -47,7 +48,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |a""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -67,7 +68,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |a""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -104,7 +105,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |c""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -138,7 +139,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |c""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -191,7 +192,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |e""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -260,7 +261,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |e+""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -295,7 +296,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |b""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -330,7 +331,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |ab+""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -373,7 +374,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |ab+""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -421,7 +422,7 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |ab+""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -495,6 +496,6 @@ class DivergentTest : GfmRenderingOnlyTestBase() { |e+""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } } diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt index 1d6a79ca..d442b4b9 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/GroupWrappingTest.kt @@ -2,8 +2,9 @@ package renderers.gfm import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.pages.TextStyle -import org.junit.jupiter.api.Test import renderers.testPage +import kotlin.test.Test +import kotlin.test.assertEquals class GroupWrappingTest : GfmRenderingOnlyTestBase() { @@ -21,7 +22,7 @@ class GroupWrappingTest : GfmRenderingOnlyTestBase() { |abc""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -40,7 +41,7 @@ class GroupWrappingTest : GfmRenderingOnlyTestBase() { |c""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -59,7 +60,7 @@ class GroupWrappingTest : GfmRenderingOnlyTestBase() { |c""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -85,6 +86,6 @@ class GroupWrappingTest : GfmRenderingOnlyTestBase() { |d""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } } diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt index e102f52a..a630576a 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SimpleElementsTest.kt @@ -6,10 +6,10 @@ import org.jetbrains.dokka.pages.ContentEmbeddedResource import org.jetbrains.dokka.pages.ContentKind import org.jetbrains.dokka.pages.DCI import org.jetbrains.dokka.pages.TextStyle -import org.junit.Assert.assertEquals -import org.junit.jupiter.api.Test import renderers.RawTestPage import renderers.testPage +import kotlin.test.Test +import kotlin.test.assertEquals class SimpleElementsTest : GfmRenderingOnlyTestBase() { diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt index dae9983a..9f8263ac 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt @@ -4,10 +4,11 @@ import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform import org.jetbrains.dokka.gfm.renderer.CommonmarkRenderer import org.jetbrains.dokka.pages.TextStyle -import org.junit.jupiter.api.Test import renderers.testPage import testApi.testRunner.defaultSourceSet import java.io.File +import kotlin.test.Test +import kotlin.test.assertEquals class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { @@ -45,7 +46,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |abc""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -69,7 +70,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |c""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -90,7 +91,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |bc""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -108,7 +109,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |ab""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -133,7 +134,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |b""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -153,7 +154,7 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |ab""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } @Test @@ -174,6 +175,6 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { |b""".trimMargin() CommonmarkRenderer(context).render(page) - assert(renderedContent == expect) + assertEquals(expect, renderedContent) } } |