aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/linkableContent
diff options
context:
space:
mode:
authorFilip Zybała <fzybala@virtuslab.com>2020-04-28 14:23:23 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-05-13 10:03:48 +0200
commitbbfb105c1e697eb792301b9fa9d9823344734aeb (patch)
tree26a5f12165d890077f76f0c333d3994118baca5d /plugins/base/src/test/kotlin/linkableContent
parenta6d13e23a32622be9207e86e9cffc67447049259 (diff)
downloaddokka-bbfb105c1e697eb792301b9fa9d9823344734aeb.tar.gz
dokka-bbfb105c1e697eb792301b9fa9d9823344734aeb.tar.bz2
dokka-bbfb105c1e697eb792301b9fa9d9823344734aeb.zip
SourceLinksTransformer: Fixed invalid cast exception, platform tags in sources table, splitted invoke function to methods.
Diffstat (limited to 'plugins/base/src/test/kotlin/linkableContent')
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 71854035..bf1d52d8 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -1,9 +1,12 @@
package linkableContent
import org.jetbrains.dokka.SourceLinkDefinitionImpl
+import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.transformers.pages.samples.DefaultSamplesTransformer
import org.jetbrains.dokka.base.transformers.pages.sourcelinks.SourceLinksTransformer
+import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder
import org.jetbrains.dokka.pages.*
+import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.junit.jupiter.api.Assertions
@@ -89,8 +92,13 @@ class LinkableContentTest : AbstractCoreTest() {
testFromData(configuration) {
renderingStage = { rootPageNode, dokkaContext ->
- val newRoot = SourceLinksTransformer(dokkaContext).invoke(rootPageNode)
-
+ val newRoot = SourceLinksTransformer(dokkaContext,
+ PageContentBuilder(
+ dokkaContext.single(dokkaContext.plugin<DokkaBase>().commentsToContentConverter),
+ dokkaContext.single(dokkaContext.plugin<DokkaBase>().signatureProvider),
+ dokkaContext.logger
+ )
+ ).invoke(rootPageNode)
val moduleChildren = newRoot.children
Assertions.assertEquals(1, moduleChildren.size)
val packageChildren = moduleChildren.first().children
@@ -98,7 +106,8 @@ class LinkableContentTest : AbstractCoreTest() {
packageChildren.forEach {
val name = it.name.substringBefore("Class")
val crl = it.safeAs<ClasslikePageNode>()?.content?.safeAs<ContentGroup>()?.children?.last()
- ?.safeAs<PlatformHintedContent>()?.children?.singleOrNull().safeAs<ContentResolvedLink>()
+ ?.safeAs<ContentGroup>()?.children?.last()?.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