aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/linkableContent
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2022-07-29 23:20:02 +0300
committerGitHub <noreply@github.com>2022-07-29 23:20:02 +0300
commit018af7d18f50b0677a31714e29744ac2d8713c4f (patch)
treeccd6b441fd5b92cbc8087875e457a03279a41980 /plugins/base/src/test/kotlin/linkableContent
parent7a875ee7d20b67725debd4c2c9e1f93e1889c302 (diff)
downloaddokka-018af7d18f50b0677a31714e29744ac2d8713c4f.tar.gz
dokka-018af7d18f50b0677a31714e29744ac2d8713c4f.tar.bz2
dokka-018af7d18f50b0677a31714e29744ac2d8713c4f.zip
Move source links into signature (#2476)
Diffstat (limited to 'plugins/base/src/test/kotlin/linkableContent')
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt7
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 1a4bb330..fadc8e83 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test
+import utils.assertNotNull
import java.net.URL
import java.nio.file.Paths
@@ -131,10 +132,8 @@ class LinkableContentTest : BaseAbstractTest() {
Assertions.assertEquals(2, packageChildren.size)
packageChildren.forEach {
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>()
+ val signature = it.safeAs<ClasslikePageNode>()?.content?.dfs { it is ContentGroup && it.dci.kind == ContentKind.Symbol }.assertNotNull("signature")
+ val crl = signature.children.last().children[1].safeAs<ContentResolvedLink>()
Assertions.assertEquals(
"https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3",
crl?.address