Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Nov 15, 2023
1 parent 1fb8d31 commit 01504b1
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package model

import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.PointingToDeclaration
Expand All @@ -26,6 +27,48 @@ class MultiLanguageInheritanceTest : BaseAbstractTest() {
}
}

@Test
fun `should not try to find javadoc for non JVM source set`() {
// Bug #3209 is actual for Dokka K1
// Technical note: `KtPropertyAccessor`, i.e. `<get-withHintType>`, is not KtCallableDeclaration so `findKDoc` returns null
// Meanwhile, `getJavaDocs()` for KtPropertyAccessor tries to unexpectedly parse the KDoc documentation of property, i.e. `withHintType`

val nonJvmConfiguration = dokkaConfiguration {
suppressObviousFunctions = false
sourceSets {
sourceSet {
analysisPlatform = Platform.common.key
sourceRoots = listOf("src/main/kotlin")
}
}
}

testInline(
"""
|/src/main/kotlin/sample/Parent.kt
|package sample
|
|/**
| * Sample description from parent
| */
|interface Parent {
| /**
| * Sample description from parent
| */
| val withHintType: String
|}
|
|/src/main/kotlin/sample/Child.kt
|package sample
|public class Child : Parent {
| override val withHintType: String
| get() = ""
|}
""".trimIndent(),
nonJvmConfiguration
) { }
}

@Test
fun `from java to kotlin`() {
testInline(
Expand Down

0 comments on commit 01504b1

Please sign in to comment.