From 018af7d18f50b0677a31714e29744ac2d8713c4f Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Fri, 29 Jul 2022 23:20:02 +0300 Subject: Move source links into signature (#2476) --- .../base/src/test/kotlin/linkableContent/LinkableContentTest.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/test/kotlin/linkableContent') 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()?.content?.safeAs()?.children?.last() - ?.safeAs()?.children?.last()?.safeAs()?.children?.lastOrNull() - ?.safeAs()?.children?.singleOrNull() - ?.safeAs()?.children?.singleOrNull().safeAs() + val signature = it.safeAs()?.content?.dfs { it is ContentGroup && it.dci.kind == ContentKind.Symbol }.assertNotNull("signature") + val crl = signature.children.last().children[1].safeAs() Assertions.assertEquals( "https://github.com/user/repo/tree/master/src/${name.toLowerCase()}Main/kotlin/${name}Class.kt#L3", crl?.address -- cgit