aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/transformers
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/transformers
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/transformers')
-rw-r--r--plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt59
1 files changed, 55 insertions, 4 deletions
diff --git a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
index 8703a4a9..9a77172b 100644
--- a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
@@ -1,13 +1,14 @@
package transformers
+import matchers.content.*
import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.doc.*
-import org.junit.jupiter.api.Assertions.*
-import org.junit.jupiter.api.Test
-import matchers.content.*
import org.jetbrains.dokka.pages.*
import org.jetbrains.kotlin.utils.addToStdlib.assertedCast
+import org.junit.jupiter.api.Assertions.assertEquals
+import org.junit.jupiter.api.Assertions.assertTrue
+import org.junit.jupiter.api.Test
class CommentsToContentConverterTest {
private val converter = DocTagToContentConverter()
@@ -422,4 +423,54 @@ class CommentsToContentConverterTest {
}
}
}
-} \ No newline at end of file
+
+ @Test
+ fun `description list`() {
+ val docTag =
+ Dl(
+ listOf(
+ Dt(
+ listOf(
+ Text("description list can have...")
+ )
+ ),
+ Dt(
+ listOf(
+ Text("... two consecutive description terms")
+ )
+ ),
+ Dd(
+ listOf(
+ Text("and usually has some sort of a description, like this one")
+ )
+ )
+ )
+ )
+
+ executeTest(docTag) {
+ composite<ContentList> {
+ check {
+ assertTrue(style.contains(ListStyle.DescriptionList)) { "Expected DL style" }
+ }
+ group {
+ check {
+ assertTrue(style.contains(ListStyle.DescriptionTerm)) { "Expected DT style" }
+ }
+ +"description list can have..."
+ }
+ group {
+ check {
+ assertTrue(style.contains(ListStyle.DescriptionTerm)) { "Expected DT style" }
+ }
+ +"... two consecutive description terms"
+ }
+ group {
+ check {
+ assertTrue(style.contains(ListStyle.DescriptionDetails)) { "Expected DD style" }
+ }
+ +"and usually has some sort of a description, like this one"
+ }
+ }
+ }
+ }
+}