diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-05 16:01:39 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-05 16:01:39 +0300 |
commit | 7aa5b52a7e8cd69a384ef29aeeb199061b92584f (patch) | |
tree | b823939e0d5265745669047d6647c860555b0717 /core/src | |
parent | 14ba5834fa3fff98672166dd24c05bd7aa13dc2a (diff) | |
download | dokka-7aa5b52a7e8cd69a384ef29aeeb199061b92584f.tar.gz dokka-7aa5b52a7e8cd69a384ef29aeeb199061b92584f.tar.bz2 dokka-7aa5b52a7e8cd69a384ef29aeeb199061b92584f.zip |
Check file path in testData, when more then one node
Diffstat (limited to 'core/src')
-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 |