diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-25 14:22:51 +0200 |
---|---|---|
committer | Andrzej Ratajczak <32793002+BarkingBad@users.noreply.github.com> | 2020-09-08 12:52:59 +0200 |
commit | a1f8efc30b4421ce371b02b747bbeac24fafd7ba (patch) | |
tree | 7dba1baab9ad4d8db7436e65c7e9c26618a07c89 /plugins/base/src/test/kotlin/signatures | |
parent | 270ff58ea44b7700be45062f75bbc7fd50d183eb (diff) | |
download | dokka-a1f8efc30b4421ce371b02b747bbeac24fafd7ba.tar.gz dokka-a1f8efc30b4421ce371b02b747bbeac24fafd7ba.tar.bz2 dokka-a1f8efc30b4421ce371b02b747bbeac24fafd7ba.zip |
Changed way of merging documentables to avoid exception on merging documentables of different types. Minor javadoc fixes. Changed constructor names. Add handling same name pages clash for different platforms
Diffstat (limited to 'plugins/base/src/test/kotlin/signatures')
-rw-r--r-- | plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt | 135 |
1 files changed, 37 insertions, 98 deletions
diff --git a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt index 2e8e0ef3..975373b6 100644 --- a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt @@ -10,40 +10,43 @@ import utils.TestOutputWriterPlugin class DivergentSignatureTest : AbstractCoreTest() { - @Test - fun `group { common + jvm + js }`() { - - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } + 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()) } } + } + + @Test + fun `group { common + jvm + js }`() { val writerPlugin = TestOutputWriterPlugin() @@ -55,7 +58,7 @@ class DivergentSignatureTest : AbstractCoreTest() { val content = writerPlugin.renderedContent("example/example/-clock/get-time.html") assert(content.count() == 1) - assert(content.select("[data-filterable-current=example/js example/jvm example/common]").single().brief == "") + assert(content.select("[data-filterable-current=example/common example/jvm example/js]").single().brief == "common") } } } @@ -63,38 +66,6 @@ class DivergentSignatureTest : AbstractCoreTest() { @Test fun `group { common + jvm }, group { js }`() { - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - } - } - val writerPlugin = TestOutputWriterPlugin() testFromData( @@ -104,7 +75,7 @@ class DivergentSignatureTest : AbstractCoreTest() { renderingStage = { _, _ -> val content = writerPlugin.renderedContent("example/example/-clock/get-times-in-millis.html") assert(content.count() == 2) - assert(content.select("[data-filterable-current=example/jvm example/common]").single().brief == "Time in minis") + assert(content.select("[data-filterable-current=example/common example/jvm]").single().brief == "Time in minis common") assert(content.select("[data-filterable-current=example/js]").single().brief == "JS implementation of getTimeInMillis js" ) } } @@ -113,38 +84,6 @@ class DivergentSignatureTest : AbstractCoreTest() { @Test fun `group { js }, group { jvm }, group { js }`() { - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - } - } - val writerPlugin = TestOutputWriterPlugin() testFromData( |