aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/transformers
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2021-12-06 16:20:51 +0300
committerIgnat Beresnev <ignat.beresnev@jetbrains.com>2021-12-06 16:20:51 +0300
commitc68c05a1e8876e9b8555df7bcdfeaca3e100f0d1 (patch)
treed9c20d2118d6679175ef8ab9f7dfc6d49aba5af3 /plugins/base/src/test/kotlin/transformers
parent35a69e0322fcd271dccadcc2ee8cbb61dcafe62e (diff)
downloaddokka-c68c05a1e8876e9b8555df7bcdfeaca3e100f0d1.tar.gz
dokka-c68c05a1e8876e9b8555df7bcdfeaca3e100f0d1.tar.bz2
dokka-c68c05a1e8876e9b8555df7bcdfeaca3e100f0d1.zip
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.kt57
1 files changed, 54 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
index 8703a4a9..6d8730f1 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 {
}
}
}
+
+ @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"
+ }
+ }
+ }
+ }
} \ No newline at end of file