diff options
Diffstat (limited to 'core/src/test')
-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) } } |