From 519bc7969930f191fb7d9155b1c07f7e226e219f Mon Sep 17 00:00:00 2001 From: Szymon Świstun Date: Tue, 11 Feb 2020 18:29:19 +0100 Subject: page merger strategy with tests --- .../kotlin/pageMerger/DefaultPageNodeMergerTest.kt | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 core/src/test/kotlin/pageMerger/DefaultPageNodeMergerTest.kt (limited to 'core/src/test/kotlin/pageMerger/DefaultPageNodeMergerTest.kt') diff --git a/core/src/test/kotlin/pageMerger/DefaultPageNodeMergerTest.kt b/core/src/test/kotlin/pageMerger/DefaultPageNodeMergerTest.kt deleted file mode 100644 index 432820af..00000000 --- a/core/src/test/kotlin/pageMerger/DefaultPageNodeMergerTest.kt +++ /dev/null @@ -1,51 +0,0 @@ -package pageMerger - -import org.jetbrains.dokka.pages.ContentPage -import org.jetbrains.dokka.pages.PageNode -import org.junit.Test -import testApi.testRunner.AbstractCoreTest - -class DefaultPageNodeMergerTest : AbstractCoreTest() { - - @Test - fun test1() { - val configuration = dokkaConfiguration { - passes { - pass { - sourceRoots = listOf("src/main/kotlin/pageMerger/Test.kt") - } - } - } - - testInline( - """ - |/src/main/kotlin/pageMerger/Test.kt - |package pageMerger - | - |fun testT(): Int = 1 - |fun testT(i: Int): Int = i - | - |object Test { - | fun test(): String = "" - | fun test(str: String): String = str - |} - """.trimMargin(), - configuration - ) { - pagesTransformationStage = { - val allChildren = it.childrenRec().filterIsInstance() - val testT = allChildren.filter { it.name == "testT" } - val test = allChildren.filter { it.name == "test" } - - assert(testT.size == 1) { "There can be only one testT page" } - assert(testT.first().dri.size == 2) { "testT page should have 2 DRI" } - - assert(test.size == 1) { "There can be only one test page" } - assert(test.first().dri.size == 2) { "test page should have 2 DRI" } - } - } - } - - fun PageNode.childrenRec(): List = listOf(this) + children.flatMap { it.childrenRec() } - -} \ No newline at end of file -- cgit