diff options
Diffstat (limited to 'plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt | 50 |
1 files changed, 5 insertions, 45 deletions
diff --git a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt index 0d40821b..6471f555 100644 --- a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt @@ -7,43 +7,9 @@ import org.jsoup.select.Elements import org.junit.jupiter.api.Test import java.nio.file.Paths import utils.TestOutputWriterPlugin +import kotlin.test.assertEquals -class DivergentSignatureTest : BaseAbstractTest() { - - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - val common = sourceSet { - name = "common" - displayName = "common" - analysisPlatform = "common" - sourceRoots = listOf(Paths.get("$testDataDir/commonMain/kotlin").toString()) - } - val jvmAndJsSecondCommonMain = sourceSet { - name = "jvmAndJsSecondCommonMain" - displayName = "jvmAndJsSecondCommonMain" - analysisPlatform = "common" - dependentSourceSets = setOf(common.value.sourceSetID) - sourceRoots = listOf(Paths.get("$testDataDir/jvmAndJsSecondCommonMain/kotlin").toString()) - } - val js = sourceSet { - name = "js" - displayName = "js" - analysisPlatform = "js" - dependentSourceSets = setOf(common.value.sourceSetID, jvmAndJsSecondCommonMain.value.sourceSetID) - sourceRoots = listOf(Paths.get("$testDataDir/jsMain/kotlin").toString()) - } - val jvm = sourceSet { - name = "jvm" - displayName = "jvm" - analysisPlatform = "jvm" - dependentSourceSets = setOf(common.value.sourceSetID, jvmAndJsSecondCommonMain.value.sourceSetID) - sourceRoots = listOf(Paths.get("$testDataDir/jvmMain/kotlin").toString()) - } - } - } +class DivergentSignatureTest : AbstractRenderingTest() { @Test fun `group { common + jvm + js }`() { @@ -55,7 +21,7 @@ class DivergentSignatureTest : BaseAbstractTest() { pluginOverrides = listOf(writerPlugin) ) { renderingStage = { _, _ -> - val content = writerPlugin.renderedContent("example/example/-clock/get-time.html") + val content = writerPlugin.renderedDivergentContent("example/example/-clock/get-time.html") assert(content.count() == 1) assert(content.select("[data-filterable-current=example/common example/js example/jvm]").single().brief == "") @@ -73,7 +39,7 @@ class DivergentSignatureTest : BaseAbstractTest() { pluginOverrides = listOf(writerPlugin) ) { renderingStage = { _, _ -> - val content = writerPlugin.renderedContent("example/example/-clock/get-times-in-millis.html") + val content = writerPlugin.renderedDivergentContent("example/example/-clock/get-times-in-millis.html") assert(content.count() == 2) assert(content.select("[data-filterable-current=example/common example/jvm]").single().brief == "Time in minis") assert(content.select("[data-filterable-current=example/js]").single().brief == "JS implementation of getTimeInMillis" ) @@ -91,7 +57,7 @@ class DivergentSignatureTest : BaseAbstractTest() { pluginOverrides = listOf(writerPlugin) ) { renderingStage = { _, _ -> - val content = writerPlugin.renderedContent("example/example/-clock/get-year.html") + val content = writerPlugin.renderedDivergentContent("example/example/-clock/get-year.html") assert(content.count() == 3) assert(content.select("[data-filterable-current=example/jvm]").single().brief == "JVM custom kdoc") assert(content.select("[data-filterable-current=example/js]").single().brief == "JS custom kdoc") @@ -99,10 +65,4 @@ class DivergentSignatureTest : BaseAbstractTest() { } } } - - private fun TestOutputWriterPlugin.renderedContent(path: String) = writer.contents.getValue(path) - .let { Jsoup.parse(it) }.select("#content").single().select("div.divergent-group") - - private val Element.brief: String - get() = children().select("p").text() } |