-
Notifications
You must be signed in to change notification settings - Fork 392
/
ParseRenderTest.kt
54 lines (47 loc) · 1.64 KB
/
ParseRenderTest.kt
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
package renderers.gfm
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.gfm.GfmPlugin
import org.junit.Assert.assertEquals
import org.junit.jupiter.api.Test
import utils.TestOutputWriterPlugin
class ParseRenderTest : BaseAbstractTest() {
@Test
fun `deprecated fun markdown`() {
val configuration = dokkaConfiguration {
sourceSets {
sourceSet {
sourceRoots = listOf("src/main/kotlin/test/Test.kt")
}
}
}
val source =
"""
|/src/main/kotlin/test/Test.kt
|package example
| /**
| * Just a deprecated function
| */
| @Deprecated("This is deprecated")
| fun simpleFun(test: Int): String = "This is the one ring"
""".trimIndent()
val expected =
"""
//[root](../../index.md)/[example](index.md)
# Package example
## Functions
| Name | Summary |
|---|---|
| [simpleFun](simple-fun.md) | [JVM]<br><s>fun</s> [<s>simpleFun</s>](simple-fun.md)<s>(</s><s>test</s><s>:</s> Int<s>)</s><s>:</s> String<br>Just a deprecated function |
""".trimIndent()
val writerPlugin = TestOutputWriterPlugin()
testInline(
source,
configuration,
pluginOverrides = listOf(writerPlugin, GfmPlugin())
) {
renderingStage = { _, _ ->
assertEquals(expected, writerPlugin.writer.contents["root/example/index.md"])
}
}
}
}