From 7aa5b52a7e8cd69a384ef29aeeb199061b92584f Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 5 Dec 2017 16:01:39 +0300 Subject: Check file path in testData, when more then one node --- core/src/test/kotlin/format/FileGeneratorTestCase.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/src/test/kotlin/format') 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, 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("") + } + sb.append(loc.file.readText()) } } } \ No newline at end of file -- cgit