aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/TestAPI.kt6
-rw-r--r--test/src/model/CommentTest.kt35
2 files changed, 41 insertions, 0 deletions
diff --git a/test/src/TestAPI.kt b/test/src/TestAPI.kt
index 901e78fc..7d0d3bdd 100644
--- a/test/src/TestAPI.kt
+++ b/test/src/TestAPI.kt
@@ -73,6 +73,12 @@ fun StringBuilder.appendNode(node: ContentNode): StringBuilder {
append(node.text)
}
is ContentEmphasis -> append("*").appendChildren(node).append("*")
+ is ContentBlockCode -> {
+ appendln("[code]")
+ appendChildren(node)
+ appendln()
+ appendln("[/code]")
+ }
is ContentNodeLink -> {
append("[")
appendChildren(node)
diff --git a/test/src/model/CommentTest.kt b/test/src/model/CommentTest.kt
index 2d87b928..63a957e7 100644
--- a/test/src/model/CommentTest.kt
+++ b/test/src/model/CommentTest.kt
@@ -142,4 +142,39 @@ line two""", toTestString())
}
}
}
+
+ Test fun directive() {
+ verifyModel("test/data/comments/directive.kt") { model ->
+ with(model.members.single().members.first()) {
+ assertEquals("Summary", content.summary.toTestString())
+ assertEquals(2, content.sections.count())
+ with (content.description) {
+ assertEquals("""[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())
+ }
+ }
+ }
+ }
}