diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 16:35:45 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 16:35:45 +0100 |
commit | 99689adee954582da57268ff0375fdec52193a01 (patch) | |
tree | 82b41b04e568a564ba91473e1dcaba25b611a2b6 /core/src/test/kotlin | |
parent | a39c7a161282d132d08bcf89eed0213374a574e9 (diff) | |
download | dokka-99689adee954582da57268ff0375fdec52193a01.tar.gz dokka-99689adee954582da57268ff0375fdec52193a01.tar.bz2 dokka-99689adee954582da57268ff0375fdec52193a01.zip |
Merge declarations with the same signature defined for multiple platforms
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r-- | core/src/test/kotlin/TestAPI.kt | 3 | ||||
-rw-r--r-- | core/src/test/kotlin/format/MarkdownFormatTest.kt | 26 |
2 files changed, 24 insertions, 5 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index b3085008..a003cd60 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -81,7 +81,8 @@ fun appendDocumentation(documentation: DocumentationModule, skipEmptyPackages = false, sourceLinks = listOf<SourceLinkDefinition>(), generateIndexPages = false) - val injector = Guice.createInjector(DokkaAnalysisModule(environment, options, implicitPlatforms, DokkaConsoleLogger)) + val injector = Guice.createInjector( + DokkaAnalysisModule(environment, options, implicitPlatforms, documentation.nodeRefGraph, DokkaConsoleLogger)) buildDocumentationModule(injector, documentation) Disposer.dispose(environment) } diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index 967bc5e4..dda31d11 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -243,11 +243,29 @@ class MarkdownFormatTest { } @Test fun multiplePlatforms() { + verifyMultiplatformPackage(buildMultiplePlatforms("multiplatform"), "multiplatform") + } + + @Test fun multiplePlatformsMerge() { + verifyMultiplatformPackage(buildMultiplePlatforms("multiplatformMerge"), "multiplatformMerge") + } + + @Test fun multiplePlatformsMergeMembers() { + val module = buildMultiplePlatforms("multiplatformMergeMembers") + verifyModelOutput(module, ".md", "testdata/format/multiplatformMergeMembers/foo.kt") { model, output -> + markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members.single().members) + } + } + + private fun buildMultiplePlatforms(path: String): DocumentationModule { val module = DocumentationModule("test") - val sourcePath = "testdata/format/multiplatform/foo.kt" - appendDocumentation(module, contentRootFromPath(sourcePath), implicitPlatforms = listOf("JVM")) - appendDocumentation(module, contentRootFromPath("testdata/format/multiplatform/bar.kt"), implicitPlatforms = listOf("JS")) - verifyModelOutput(module, ".package.md", sourcePath) { model, output -> + appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), implicitPlatforms = listOf("JVM")) + appendDocumentation(module, contentRootFromPath("testdata/format/$path/js.kt"), implicitPlatforms = listOf("JS")) + return module + } + + private fun verifyMultiplatformPackage(module: DocumentationModule, path: String) { + verifyModelOutput(module, ".package.md", "testdata/format/$path/multiplatform.kt") { model, output -> markdownService.createOutputBuilder(output, tempLocation).appendNodes(model.members) } } |