aboutsummaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/kotlin/javadoc/JavadocTest.kt17
1 files changed, 17 insertions, 0 deletions
diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt
index 41d22b47..4c0f7f0f 100644
--- a/core/src/test/kotlin/javadoc/JavadocTest.kt
+++ b/core/src/test/kotlin/javadoc/JavadocTest.kt
@@ -1,5 +1,6 @@
package org.jetbrains.dokka.javadoc
+import com.sun.javadoc.Type
import org.jetbrains.dokka.DokkaConsoleLogger
import org.jetbrains.dokka.tests.verifyModel
import org.junit.Assert.*
@@ -107,6 +108,22 @@ class JavadocTest {
}
}
+ @Test fun testTypeAliases() {
+ verifyJavadoc("testdata/javadoc/typealiases.kt", withKotlinRuntime = true) { doc ->
+ assertNull(doc.classNamed("B"))
+ assertNull(doc.classNamed("D"))
+
+ assertEquals("A", doc.classNamed("C")!!.superclass().name())
+ val methodParamType = doc.classNamed("TypealiasesKt")!!.methods()
+ .find { it.name() == "some" }!!.parameters().first()
+ .type()
+ assertEquals("kotlin.jvm.functions.Function1", methodParamType.qualifiedTypeName())
+ assertEquals("? super A, C", methodParamType.asParameterizedType().typeArguments()
+ .map(Type::qualifiedTypeName).joinToString())
+ }
+ }
+
+
private fun verifyJavadoc(name: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,