diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-03-24 11:02:56 +0100 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-03-25 12:50:44 +0100 |
commit | 3c6624aa876b9b55baa32b121240f7bc7eda8116 (patch) | |
tree | 1d33fe52119c86ae108227de8bf73c9bf6b052d3 /plugins/base/src | |
parent | 646d2fbd2a0d1e898a14ac942c43511bfd0a1c95 (diff) | |
download | dokka-3c6624aa876b9b55baa32b121240f7bc7eda8116.tar.gz dokka-3c6624aa876b9b55baa32b121240f7bc7eda8116.tar.bz2 dokka-3c6624aa876b9b55baa32b121240f7bc7eda8116.zip |
Fix link parsing for links with fq names
Diffstat (limited to 'plugins/base/src')
-rw-r--r-- | plugins/base/src/test/kotlin/markdown/KDocTest.kt | 2 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/markdown/LinkTest.kt | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/markdown/KDocTest.kt b/plugins/base/src/test/kotlin/markdown/KDocTest.kt index a904f725..f9d717b0 100644 --- a/plugins/base/src/test/kotlin/markdown/KDocTest.kt +++ b/plugins/base/src/test/kotlin/markdown/KDocTest.kt @@ -6,7 +6,7 @@ import org.jetbrains.dokka.pages.ModulePageNode import org.junit.jupiter.api.Assertions.* import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest -open class KDocTest : AbstractCoreTest() { +abstract class KDocTest : AbstractCoreTest() { private val configuration = dokkaConfiguration { passes { diff --git a/plugins/base/src/test/kotlin/markdown/LinkTest.kt b/plugins/base/src/test/kotlin/markdown/LinkTest.kt new file mode 100644 index 00000000..d38486b5 --- /dev/null +++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt @@ -0,0 +1,46 @@ +package markdown + +import org.jetbrains.dokka.pages.ContentDRILink +import org.jetbrains.dokka.pages.MemberPageNode +import org.jetbrains.dokka.pages.dfs +import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test + +class LinkTest : AbstractCoreTest() { + @Test + fun linkToClassLoader() { + val configuration = dokkaConfiguration { + passes { + pass { + sourceRoots = listOf("src/main/kotlin/parser") + } + } + } + testInline( + """ + |/src/main/kotlin/parser/Test.kt + |package parser + | + | /** + | * Some docs that link to [ClassLoader.clearAssertionStatus] + | */ + |fun test(x: ClassLoader) = x.clearAssertionStatus() + | + """.trimMargin(), + configuration + ) { + renderingStage = { rootPageNode, _ -> + (rootPageNode.children.single().children.single() as MemberPageNode) + .content + .dfs { node -> node is ContentDRILink } + .let { + assertEquals( + "parser//test/#java.lang.ClassLoader//", + (it as ContentDRILink).address.toString() + ) + } + } + } + } +}
\ No newline at end of file |