aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/content
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-06-26 17:01:48 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-02 13:14:08 +0200
commitae8b4481b56d6bac4a3feb6a427e77afdbe36b2f (patch)
tree2708bb3718be7a9d351bfcecb0a0e45d5485691b /plugins/base/src/test/kotlin/content
parent7b8d341efbaf96abe6c5c848bccfd74d7ddce606 (diff)
downloaddokka-ae8b4481b56d6bac4a3feb6a427e77afdbe36b2f.tar.gz
dokka-ae8b4481b56d6bac4a3feb6a427e77afdbe36b2f.tar.bz2
dokka-ae8b4481b56d6bac4a3feb6a427e77afdbe36b2f.zip
Show fully qualified name for typealias targets to different packages
Diffstat (limited to 'plugins/base/src/test/kotlin/content')
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt89
1 files changed, 86 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
index 20aba2e8..6cb8b0f4 100644
--- a/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
+++ b/plugins/base/src/test/kotlin/content/signatures/ContentForSignaturesTest.kt
@@ -1,13 +1,15 @@
package content.signatures
import matchers.content.*
-import org.jetbrains.dokka.pages.ContentPage
-import org.jetbrains.dokka.pages.PackagePageNode
+import org.jetbrains.dokka.links.DRI
+import org.jetbrains.dokka.model.doc.Text
+import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
import org.junit.jupiter.api.Test
import utils.ParamAttributes
import utils.bareSignature
import utils.propertySignature
+import utils.typealiasSignature
class ContentForSignaturesTest : AbstractCoreTest() {
@@ -370,4 +372,85 @@ class ContentForSignaturesTest : AbstractCoreTest() {
}
}
}
-} \ No newline at end of file
+
+ @Test
+ fun `typealias to String`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |
+ |typealias Alias = String
+ """.trimIndent(), testConfiguration
+ ) {
+ pagesTransformationStage = { module ->
+ val page = module.children.single { it.name == "test" } as PackagePageNode
+ page.content.assertNode {
+ typealiasSignature("Alias", "String")
+ }
+ }
+ }
+ }
+
+ @Test
+ fun `typealias to Int`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |
+ |typealias Alias = Int
+ """.trimIndent(), testConfiguration
+ ) {
+ pagesTransformationStage = { module ->
+ val page = module.children.single { it.name == "test" } as PackagePageNode
+ page.content.assertNode {
+ typealiasSignature("Alias", "Int")
+ }
+ }
+ }
+ }
+
+ @Test
+ fun `typealias to type in same package`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |
+ |typealias Alias = X
+ |class X
+ """.trimIndent(), testConfiguration
+ ) {
+ pagesTransformationStage = { module ->
+ val page = module.children.single { it.name == "test" } as PackagePageNode
+ page.content.assertNode {
+ typealiasSignature("Alias", "X")
+ }
+ }
+ }
+ }
+
+ @Test
+ fun `typealias to type in different package`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/source.kt
+ |package test
+ |import other.X
+ |typealias Alias = X
+ |
+ |/src/main/kotlin/test/source2.kt
+ |package other
+ |class X
+ """.trimIndent(), testConfiguration
+ ) {
+ pagesTransformationStage = { module ->
+ val page = module.children.single { it.name == "test" } as PackagePageNode
+ page.content.assertNode {
+ typealiasSignature("Alias", "other.X")
+ }
+ }
+ }
+ }
+}