diff options
Diffstat (limited to 'plugins/base/src/test/kotlin')
-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 |