aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/translators/Bug1341.kt
blob: b996723fa311072ce7a0b655be45a48b9e899084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

package translators

import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import kotlin.test.Test
import kotlin.test.assertEquals
import utils.JavaCode

class Bug1341 : BaseAbstractTest() {
    @JavaCode
    @Test
    fun `reproduce bug #1341`() {
        val configuration = dokkaConfiguration {
            sourceSets {
                sourceSet {
                    sourceRoots = listOf("src")
                    analysisPlatform = "jvm"
                }
            }
        }

        testInline(
            """
            /src/com/sample/OtherClass.kt
            package com.sample
            class OtherClass internal constructor() {
                internal annotation class CustomAnnotation
            }
            
            /src/com/sample/ClassUsingAnnotation.java
            package com.sample
            public class ClassUsingAnnotation {
                @OtherClass.CustomAnnotation
                public int doSomething() {
                    return 1;
                }
            }
            """.trimIndent(),
            configuration
        ) {
            this.documentablesMergingStage = { module ->
                assertEquals(DRI("com.sample"), module.packages.single().dri)
            }
        }
    }
}