From c68c05a1e8876e9b8555df7bcdfeaca3e100f0d1 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Mon, 6 Dec 2021 16:20:51 +0300 Subject: Description list support for JavaDocs (#2213) --- .../src/test/kotlin/parsers/JavadocParserTest.kt | 104 ++++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) (limited to 'plugins/base/src/test/kotlin/parsers') 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 + | + | /** + | *
+ | *
+ | * name="name" + | *
+ | *
+ | * A URI path segment. The subdirectory name for this value is contained in the + | * path attribute. + | *
+ | *
+ | * path="path" + | *
+ | *
+ | * The subdirectory you're sharing. While the name attribute is a URI path + | * segment, the path value is an actual subdirectory name. + | *
+ | *
+ | */ + | 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) + } + } + } } -- cgit