diff options
author | Marcin Aman <maman@virtuslab.com> | 2020-05-21 14:51:55 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-05-28 12:11:47 +0200 |
commit | 5f9299b074355e3f636da6eb6e1f9283f06ab8c7 (patch) | |
tree | 3ceb70a5dc2640f10e198535b1390c6aca14d223 /plugins/base/src/test/kotlin/basic/DRITest.kt | |
parent | dd5d4ba7d80b0880489cf74bb11549ff836fc41f (diff) | |
download | dokka-5f9299b074355e3f636da6eb6e1f9283f06ab8c7.tar.gz dokka-5f9299b074355e3f636da6eb6e1f9283f06ab8c7.tar.bz2 dokka-5f9299b074355e3f636da6eb6e1f9283f06ab8c7.zip |
Return types links in inner classes with generic parents
Diffstat (limited to 'plugins/base/src/test/kotlin/basic/DRITest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/basic/DRITest.kt | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/plugins/base/src/test/kotlin/basic/DRITest.kt b/plugins/base/src/test/kotlin/basic/DRITest.kt index 1ac05177..b09932fe 100644 --- a/plugins/base/src/test/kotlin/basic/DRITest.kt +++ b/plugins/base/src/test/kotlin/basic/DRITest.kt @@ -4,6 +4,7 @@ import org.jetbrains.dokka.links.* import org.jetbrains.dokka.model.DClass import org.jetbrains.dokka.model.DFunction import org.jetbrains.dokka.model.DParameter +import org.jetbrains.dokka.model.OtherParameter import org.jetbrains.dokka.pages.* import org.junit.jupiter.api.Assertions.assertEquals import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest @@ -212,7 +213,7 @@ class DRITest : AbstractCoreTest() { |package example | |class Sample<S>(first: S){ - | fun <T> genericFun(param1: String): Triple<S,T> = TODO() + | fun <T> genericFun(param1: String): Tuple<S,T> = TODO() |} | | @@ -239,6 +240,43 @@ class DRITest : AbstractCoreTest() { } @Test + fun driForFunctionNestedInsideInnerClass() { + val configuration = dokkaConfiguration { + passes { + pass { + sourceRoots = listOf("src/") + classpath = listOfNotNull(jvmStdlibPath) + } + } + } + testInline( + """ + |/src/main/kotlin/Test.kt + |package example + | + |class Sample<S>(first: S){ + | inner class SampleInner { + | fun foo(): S = TODO() + | } + |} + | + | + """.trimMargin(), + configuration + ) { + pagesGenerationStage = { module -> + val sampleClass = module.dfs { it.name == "Sample" } as ClasslikePageNode + val sampleInner = sampleClass.children.first { it.name == "SampleInner" } as ClasslikePageNode + val foo = sampleInner.children.first { it.name == "foo" } as MemberPageNode + val documentable = foo.documentable as DFunction + + assertEquals(sampleClass.dri.first().toString(), (documentable.type as OtherParameter).declarationDRI.toString()) + assertEquals(0, documentable.generics.size) + } + } + } + + @Test fun driForGenericExtensionFunction(){ val configuration = dokkaConfiguration { passes { |