diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-06-25 19:27:21 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-06-25 23:39:24 +0200 |
commit | 370bf45d2dca5fcd71f53c71386be8667157c446 (patch) | |
tree | e720a2277e042ecfa6753882f6cd7939f009dfc0 /plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt | |
parent | e5daeb9fe276887de95af4995ec53db2b4f407d4 (diff) | |
download | dokka-370bf45d2dca5fcd71f53c71386be8667157c446.tar.gz dokka-370bf45d2dca5fcd71f53c71386be8667157c446.tar.bz2 dokka-370bf45d2dca5fcd71f53c71386be8667157c446.zip |
Make samples runnable
Diffstat (limited to 'plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt index c2596ba3..191df066 100644 --- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt +++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt @@ -94,7 +94,8 @@ class LinkableContentTest : AbstractCoreTest() { testFromData(configuration) { renderingStage = { rootPageNode, dokkaContext -> - val newRoot = SourceLinksTransformer(dokkaContext, + val newRoot = SourceLinksTransformer( + dokkaContext, PageContentBuilder( dokkaContext.single(dokkaContext.plugin<DokkaBase>().commentsToContentConverter), dokkaContext.single(dokkaContext.plugin<DokkaBase>().signatureProvider), @@ -109,7 +110,8 @@ class LinkableContentTest : AbstractCoreTest() { val name = it.name.substringBefore("Class") val crl = it.safeAs<ClasslikePageNode>()?.content?.safeAs<ContentGroup>()?.children?.last() ?.safeAs<ContentGroup>()?.children?.last()?.safeAs<ContentGroup>()?.children?.lastOrNull() - ?.safeAs<ContentTable>()?.children?.singleOrNull()?.safeAs<ContentGroup>()?.children?.singleOrNull().safeAs<ContentResolvedLink>() + ?.safeAs<ContentTable>()?.children?.singleOrNull() + ?.safeAs<ContentGroup>()?.children?.singleOrNull().safeAs<ContentResolvedLink>() Assertions.assertEquals( "https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3", crl?.address @@ -166,7 +168,12 @@ class LinkableContentTest : AbstractCoreTest() { .cast<ContentGroup>().children.single() .cast<ContentCode>().children.single().cast<ContentText>().text Assertions.assertEquals( - "${name}Class().printWithExclamation(\"Hi, $name\")", + """|import p2.${name}Class + |fun main() { + | //sampleStart + | ${name}Class().printWithExclamation("Hi, $name") + | //sampleEnd + |}""".trimMargin(), text ) } @@ -175,7 +182,7 @@ class LinkableContentTest : AbstractCoreTest() { } @Test - fun `Documenting return type for a function in inner class with generic parent`(){ + fun `Documenting return type for a function in inner class with generic parent`() { testInline( """ |/src/main/kotlin/test/source.kt |