From 99689adee954582da57268ff0375fdec52193a01 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 23 Feb 2017 16:35:45 +0100 Subject: Merge declarations with the same signature defined for multiple platforms --- core/src/test/kotlin/format/MarkdownFormatTest.kt | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'core/src/test/kotlin/format') 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) } } -- cgit