aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/CommentTest.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-01 20:31:16 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2016-11-01 20:31:16 +0300
commit7922e2a940f91b587c70dfb3d41e0048bc93a19e (patch)
tree28055ed18f6eac89419e75f3e6fd18f05ba0bcf1 /core/src/test/kotlin/model/CommentTest.kt
parentee824b90249fd1d6d868af998c6826df31ab557b (diff)
downloaddokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.tar.gz
dokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.tar.bz2
dokka-7922e2a940f91b587c70dfb3d41e0048bc93a19e.zip
Fix for GH #97 : Preserve language name of fenced code block for highlight
Diffstat (limited to 'core/src/test/kotlin/model/CommentTest.kt')
-rw-r--r--core/src/test/kotlin/model/CommentTest.kt62
1 files changed, 41 insertions, 21 deletions
diff --git a/core/src/test/kotlin/model/CommentTest.kt b/core/src/test/kotlin/model/CommentTest.kt
index 457affee..55fa3fc0 100644
--- a/core/src/test/kotlin/model/CommentTest.kt
+++ b/core/src/test/kotlin/model/CommentTest.kt
@@ -5,6 +5,26 @@ import org.junit.Assert.*
import org.jetbrains.dokka.*
public class CommentTest {
+
+ @Test fun codeBlockComment() {
+ verifyModel("testdata/comments/codeBlockComment.kt") { model ->
+ with(model.members.single().members.first()) {
+ assertEquals("""[code lang=brainfuck]
+ |++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
+ |[/code]
+ |""".trimMargin(),
+ content.toTestString())
+ }
+ with(model.members.single().members.last()) {
+ assertEquals("""[code]
+ |a + b - c
+ |[/code]
+ |""".trimMargin(),
+ content.toTestString())
+ }
+ }
+ }
+
@Test fun emptyDoc() {
verifyModel("testdata/comments/emptyDoc.kt") { model ->
with(model.members.single().members.single()) {
@@ -133,27 +153,27 @@ line two""", toTestString())
with(model.members.single().members.first()) {
assertEquals("Summary", content.summary.toTestString())
with (content.description) {
- assertEqualsIgnoringSeparators("""[code]
-if (true) {
- println(property)
-}
-[/code]
-[code]
-if (true) {
- println(property)
-}
-[/code]
-[code]
-if (true) {
- println(property)
-}
-[/code]
-[code]
-if (true) {
- println(property)
-}
-[/code]
-""", toTestString())
+ assertEqualsIgnoringSeparators("""[code lang=kotlin]
+ |if (true) {
+ | println(property)
+ |}
+ |[/code]
+ |[code lang=kotlin]
+ |if (true) {
+ | println(property)
+ |}
+ |[/code]
+ |[code lang=kotlin]
+ |if (true) {
+ | println(property)
+ |}
+ |[/code]
+ |[code lang=kotlin]
+ |if (true) {
+ | println(property)
+ |}
+ |[/code]
+ |""".trimMargin(), toTestString())
}
}
}