diff options
Diffstat (limited to 'plugins/base/base-test-utils/src/main/kotlin')
-rw-r--r-- | plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt b/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt index 0dae8ce6..09ea6083 100644 --- a/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt +++ b/plugins/base/base-test-utils/src/main/kotlin/renderers/TestPage.kt @@ -11,16 +11,8 @@ import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.base.signatures.KotlinSignatureProvider import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter -class TestPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Unit) : RootPageNode(), ContentPage { - override val dri: Set<DRI> = setOf(DRI.topLevel) - override val documentable: Documentable? = null - override val embeddedResources: List<String> = emptyList() - override val name: String - get() = "testPage" - override val children: List<PageNode> - get() = emptyList() - - override val content: ContentNode = PageContentBuilder( +fun testPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Unit): RawTestPage { + val content = PageContentBuilder( EmptyCommentConverter, KotlinSignatureProvider(EmptyCommentConverter, DokkaConsoleLogger), DokkaConsoleLogger @@ -30,15 +22,27 @@ class TestPage(callback: PageContentBuilder.DocumentableContentBuilder.() -> Uni block = callback ) + return RawTestPage(content) +} + +class RawTestPage( + override val content: ContentNode, + override val name: String = "testPage", + override val dri: Set<DRI> = setOf(DRI.topLevel), + override val documentable: Documentable? = null, + override val embeddedResources: List<String> = emptyList(), + override val children: List<PageNode> = emptyList(), +): RootPageNode(), ContentPage { override fun modified( name: String, content: ContentNode, dri: Set<DRI>, embeddedResources: List<String>, children: List<PageNode> - ) = this + ): ContentPage = this + + override fun modified(name: String, children: List<PageNode>): RootPageNode = this - override fun modified(name: String, children: List<PageNode>) = this } internal object EmptyCommentConverter : CommentsToContentConverter { |