diff options
-rw-r--r-- | core/src/test/kotlin/format/FileGeneratorTestCase.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/test/kotlin/format/FileGeneratorTestCase.kt b/core/src/test/kotlin/format/FileGeneratorTestCase.kt index 7f6d6f3f..6d70292f 100644 --- a/core/src/test/kotlin/format/FileGeneratorTestCase.kt +++ b/core/src/test/kotlin/format/FileGeneratorTestCase.kt @@ -3,6 +3,7 @@ package org.jetbrains.dokka.tests import org.jetbrains.dokka.DocumentationNode import org.jetbrains.dokka.FileGenerator import org.jetbrains.dokka.FormatService +import org.jetbrains.dokka.relativeToRoot import org.junit.Before import org.junit.Rule import org.junit.rules.TemporaryFolder @@ -23,9 +24,12 @@ abstract class FileGeneratorTestCase { fun buildPagesAndReadInto(nodes: List<DocumentationNode>, sb: StringBuilder) = with(fileGenerator) { buildPages(nodes) - nodes.forEach { - val fileForNode = location(it).file - sb.append(fileForNode.readText()) + val byLocations = nodes.groupBy { location(it) } + byLocations.forEach { (loc, _) -> + if (byLocations.size > 1) { + sb.appendln("<!-- File: ${relativeToRoot(loc)} -->") + } + sb.append(loc.file.readText()) } } }
\ No newline at end of file |