aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat@beresnev.me>2021-12-14 10:09:10 +0300
committerGitHub <noreply@github.com>2021-12-14 10:09:10 +0300
commited5d582b1a0f667c21443d1a493ff46bc5860865 (patch)
tree1733fe31493f742584763895f443f1874a4693ab /plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
parentbf9d62a7a2bb510d8099bb2bba225b95c2c064f1 (diff)
parent19b2a2d5d0986fca3cf6766a05d09d7e458aa370 (diff)
downloaddokka-ed5d582b1a0f667c21443d1a493ff46bc5860865.tar.gz
dokka-ed5d582b1a0f667c21443d1a493ff46bc5860865.tar.bz2
dokka-ed5d582b1a0f667c21443d1a493ff46bc5860865.zip
Merge pull request #2259 from Kotlin/2213-description-list-support
Description list support for JavaDocs (#2213)
Diffstat (limited to 'plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt104
1 files changed, 102 insertions, 2 deletions
diff --git a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
index e6e1e105..c066075a 100644
--- a/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
+++ b/plugins/base/src/test/kotlin/parsers/JavadocParserTest.kt
@@ -5,10 +5,9 @@ import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.DEnum
import org.jetbrains.dokka.model.DModule
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.model.doc.P
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
-import utils.*
+import utils.text
class JavadocParserTest : BaseAbstractTest() {
@@ -249,4 +248,105 @@ class JavadocParserTest : BaseAbstractTest() {
}
}
}
+
+ @Test
+ fun `description list tag`() {
+ val source = """
+ |/src/main/kotlin/test/Test.java
+ |package example
+ |
+ | /**
+ | * <dl>
+ | * <dt>
+ | * <code>name="<i>name</i>"</code>
+ | * </dt>
+ | * <dd>
+ | * A URI path segment. The subdirectory name for this value is contained in the
+ | * <code>path</code> attribute.
+ | * </dd>
+ | * <dt>
+ | * <code>path="<i>path</i>"</code>
+ | * </dt>
+ | * <dd>
+ | * The subdirectory you're sharing. While the <i>name</i> attribute is a URI path
+ | * segment, the <i>path</i> value is an actual subdirectory name.
+ | * </dd>
+ | * </dl>
+ | */
+ | public class Test {}
+ """.trimIndent()
+
+ val expected = listOf(
+ Dl(
+ listOf(
+ Dt(
+ listOf(
+ CodeInline(
+ listOf(
+ Text("name=\""),
+ I(
+ listOf(
+ Text("name")
+ )
+ ),
+ Text("\"")
+ )
+ ),
+ )
+ ),
+ Dd(
+ listOf(
+ Text(" A URI path segment. The subdirectory name for this value is contained in the "),
+ CodeInline(
+ listOf(
+ Text("path")
+ )
+ ),
+ Text(" attribute. ")
+ )
+ ),
+
+ Dt(
+ listOf(
+ CodeInline(
+ listOf(
+ Text("path=\""),
+ I(
+ listOf(
+ Text("path")
+ )
+ ),
+ Text("\"")
+ )
+ )
+ )
+ ),
+ Dd(
+ listOf(
+ Text(" The subdirectory you're sharing. While the "),
+ I(
+ listOf(
+ Text("name")
+ )
+ ),
+ Text(" attribute is a URI path segment, the "),
+ I(
+ listOf(
+ Text("path")
+ )
+ ),
+ Text(" value is an actual subdirectory name. ")
+ )
+ )
+ )
+ )
+ )
+
+ testInline(source, configuration) {
+ documentablesCreationStage = { modules ->
+ val docs = modules.first().packages.first().classlikes.single().documentation.first().value
+ assertEquals(expected, docs.children.first().root.children)
+ }
+ }
+ }
}