diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-17 13:07:29 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2016-11-24 20:15:50 +0300 |
commit | d769c4db3fdd0f2075fdfb2f9109327f3b1ef386 (patch) | |
tree | 465ee4529073ed6794959e6356a4851c81f77bb3 /core | |
parent | bac315d15c7de87cacf152d31f08c4f703abee34 (diff) | |
download | dokka-d769c4db3fdd0f2075fdfb2f9109327f3b1ef386.tar.gz dokka-d769c4db3fdd0f2075fdfb2f9109327f3b1ef386.tar.bz2 dokka-d769c4db3fdd0f2075fdfb2f9109327f3b1ef386.zip |
Added javadoc format test for simple typealiases
Diffstat (limited to 'core')
-rw-r--r-- | core/src/test/kotlin/javadoc/JavadocTest.kt | 17 | ||||
-rw-r--r-- | core/testdata/javadoc/typealiases.kt | 11 |
2 files changed, 28 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, diff --git a/core/testdata/javadoc/typealiases.kt b/core/testdata/javadoc/typealiases.kt new file mode 100644 index 00000000..bb09bfad --- /dev/null +++ b/core/testdata/javadoc/typealiases.kt @@ -0,0 +1,11 @@ +class A + +typealias B = A + +class C : B + +typealias D = (A) -> C + +fun some(d: D) { + +}
\ No newline at end of file |