aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-07-14 19:22:17 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-15 16:01:44 +0200
commitdcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1 (patch)
tree7ff9003f55c5890ca5e7d47a0f2adc58ee363201 /plugins/base/src/test/kotlin
parentac19f61e253e9d168898fe3a0f64221b697ad8be (diff)
downloaddokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.tar.gz
dokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.tar.bz2
dokka-dcd4c1c5bc13e7bb058bcd055aa2b02d7d39e9c1.zip
Fix presenting inline code in KDoc
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/markdown/ParserTest.kt4
-rw-r--r--plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt18
3 files changed, 10 insertions, 14 deletions
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index 2775fcf4..a8fc9f6d 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -166,7 +166,7 @@ class LinkableContentTest : AbstractCoreTest() {
.cast<PlatformHintedContent>().children.single()
.cast<ContentGroup>().children.single()
.cast<ContentGroup>().children.single()
- .cast<ContentCode>().children.single().cast<ContentText>().text
+ .cast<ContentCodeBlock>().children.single().cast<ContentText>().text
Assertions.assertEquals(
"""|import p2.${name}Class
|fun main() {
diff --git a/plugins/base/src/test/kotlin/markdown/ParserTest.kt b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
index 332c9766..ee6170c2 100644
--- a/plugins/base/src/test/kotlin/markdown/ParserTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/ParserTest.kt
@@ -808,7 +808,7 @@ class ParserTest : KDocTest() {
Description(
P(
listOf(
- Code(listOf(Text("Some code"))),
+ CodeInline(listOf(Text("Some code"))),
Text(" Sample text")
)
)
@@ -837,7 +837,7 @@ class ParserTest : KDocTest() {
Description(
P(
listOf(
- Code(
+ CodeBlock(
listOf(
Text("val x: Int = 0"), Br,
Text("val y: String = \"Text\""), Br, Br,
diff --git a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
index 2fe2d2ae..5197afc6 100644
--- a/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/CommentsToContentConverterTest.kt
@@ -1,17 +1,13 @@
package transformers
-import org.jetbrains.dokka.DokkaConfiguration
-import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.transformers.pages.comments.DocTagToContentConverter
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.doc.*
-import org.jetbrains.dokka.plugability.querySingle
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 utils.assertIsInstance
class CommentsToContentConverterTest {
private val converter = DocTagToContentConverter
@@ -215,11 +211,11 @@ class CommentsToContentConverterTest {
)
)
executeTest(docTag) {
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"Blockquotes are very handy in email to emulate reply text. This line is part of the same quote."
}
+"Quote break."
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"Quote"
}
}
@@ -249,15 +245,15 @@ class CommentsToContentConverterTest {
)
)
executeTest(docTag) {
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"text 1 text 2"
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"text 3 text 4"
}
+"text 5"
}
+"Quote break."
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"Quote"
}
}
@@ -267,7 +263,7 @@ class CommentsToContentConverterTest {
fun `multiline code`() {
val docTag = P(
listOf(
- Code(
+ CodeBlock(
listOf(
Text("val x: Int = 0"), Br,
Text("val y: String = \"Text\""), Br, Br,
@@ -282,7 +278,7 @@ class CommentsToContentConverterTest {
)
)
executeTest(docTag) {
- node<ContentCode> {
+ node<ContentCodeBlock> {
+"val x: Int = 0"
node<ContentBreakLine>()
+"val y: String = \"Text\""