aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/format
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-05 16:01:39 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-05 16:01:39 +0300
commit7aa5b52a7e8cd69a384ef29aeeb199061b92584f (patch)
treeb823939e0d5265745669047d6647c860555b0717 /core/src/test/kotlin/format
parent14ba5834fa3fff98672166dd24c05bd7aa13dc2a (diff)
downloaddokka-7aa5b52a7e8cd69a384ef29aeeb199061b92584f.tar.gz
Check file path in testData, when more then one node
Diffstat (limited to 'core/src/test/kotlin/format')
-rw-r--r--core/src/test/kotlin/format/FileGeneratorTestCase.kt10
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 7f6d6f3f2..6d70292f6 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