aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/dri/DRITest.kt
blob: 911e49bf993f894af9e1fe27f6de1c2315721f12 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package org.jetbrains.dokka.tests.dri

import org.jetbrains.dokka.links.Callable
import org.jetbrains.dokka.links.TypeReference
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.resolvers.toJavadocLocation
import org.junit.Test
import kotlin.test.assertEquals

class DRITest {
//    @Test
//    fun onlyClassNames() {
//        val expected = DRI(classNames = "className1.className2")
//        val actual = DRI.from("/className1.className2////")
//        assertEquals(expected, actual)
//    }

//    @Test
//    fun fullDRI() {
//        val expected = DRI("org.dokka", "className1.className2", Callable("<init>", "", listOf("Int")), 2, "something")
//        val actual = DRI.from("org.dokka/className1.className2/<init>/..Int/2/something")
//        assertEquals(expected, actual)
//    }

//    @Test
//    fun onlyExtra() {
//        val expected = DRI(null, null, null, null, "extra")
//        val actual = DRI.from("/////extra")
//        assertEquals(expected, actual)
//    }
//
//    @Test
//    fun javadoc8Location() {
//        val dri = DRI("org.jetbrains.dokka", "DRITest", "javadocLocation", ".void.")
//        assertEquals("org/jetbrains/dokka/DRITest.html#javadocLocation--", dri.toJavadocLocation(8))
//    }
//
//    @Test
//    fun parseDRI() {
//        val toParse =
//            "example//baz/example.Foo[kotlin.Comparable[*],[kotlin.collections.List[example.ReBarBar],kotlin.Comparable[*]]]#[kotlin.collections.List[example.ReBarBar],kotlin.Comparable[*]]//"
//        val dri = DRI(
//            "example",
//            "",
//            Callable(
//                "baz",
//                TypeReference(
//                    "example.Foo", listOf(
//                        TypeReference("kotlin.Comparable", listOf(TypeReference.starProjection)),
//                        TypeReference(
//                            "", listOf(
//                                TypeReference("kotlin.collections.List", listOf(TypeReference("example.ReBarBar"))),
//                                TypeReference("kotlin.Comparable", listOf(TypeReference.starProjection))
//                            )
//                        )
//                    )
//                ),
//                listOf(
//                    TypeReference(
//                        "",
//                        listOf(
//                            TypeReference("kotlin.collections.List", listOf(TypeReference("example.ReBarBar"))),
//                            TypeReference("kotlin.Comparable", listOf(TypeReference.starProjection))
//                        )
//
//                    )
//                )
//            )
//        )
//        assertEquals(dri.toString(), DRI.from(toParse).toString())
//    }
}