diff options
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/kotlin/model/LinkTest.kt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/core/src/test/kotlin/model/LinkTest.kt b/core/src/test/kotlin/model/LinkTest.kt index 1c206467..6b72525f 100644 --- a/core/src/test/kotlin/model/LinkTest.kt +++ b/core/src/test/kotlin/model/LinkTest.kt @@ -1,8 +1,10 @@ package org.jetbrains.dokka.tests +import org.jetbrains.dokka.ContentBlock +import org.jetbrains.dokka.ContentNodeLazyLink import org.jetbrains.dokka.NodeKind -import org.junit.Test import org.junit.Assert.assertEquals +import org.junit.Test class LinkTest { @Test fun linkToSelf() { @@ -55,4 +57,19 @@ class LinkTest { } } + @Test fun linkToPackage() { + verifyModel("testdata/links/linkToPackage.kt") { model -> + val packageNode = model.members.single() + with(packageNode) { + assertEquals(this.name, "test.magic") + } + with(packageNode.members.single()) { + assertEquals("Magic", name) + assertEquals(NodeKind.Class, kind) + assertEquals("Basic implementations of [Magic -> Class:Magic] are located in [test.magic -> Package:test.magic] package", content.summary.toTestString()) + assertEquals(packageNode, ((this.content.summary as ContentBlock).children.filterIsInstance<ContentNodeLazyLink>().last()).lazyNode.invoke()) + } + } + } + }
\ No newline at end of file |