aboutsummaryrefslogtreecommitdiff
path: root/test/src
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:55:20 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:55:20 +0400
commita83488aae453f1bf01cfb5507317acf0b9ddfb82 (patch)
treeab1c3e2370480f182ac75a2016bf2dc95d1637bb /test/src
parentd627d2cfdfebcddd63669734efb82dfc66e7c7fe (diff)
downloaddokka-a83488aae453f1bf01cfb5507317acf0b9ddfb82.tar.gz
dokka-a83488aae453f1bf01cfb5507317acf0b9ddfb82.tar.bz2
dokka-a83488aae453f1bf01cfb5507317acf0b9ddfb82.zip
Implement section parsing.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/model/CommentTest.kt83
1 files changed, 83 insertions, 0 deletions
diff --git a/test/src/model/CommentTest.kt b/test/src/model/CommentTest.kt
index f7d313fe..6c835f8d 100644
--- a/test/src/model/CommentTest.kt
+++ b/test/src/model/CommentTest.kt
@@ -74,4 +74,87 @@ doc3""", doc.summary)
}
}
}
+
+ Test fun emptySection() {
+ verifyModel("test/data/comments/emptySection.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(1, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("", text)
+ }
+ }
+ }
+ }
+
+ Test fun section1() {
+ verifyModel("test/data/comments/section1.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(1, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("section one", text)
+ }
+ }
+ }
+ }
+
+ Test fun section2() {
+ verifyModel("test/data/comments/section2.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(2, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("section one", text)
+ }
+ with (doc.sections.elementAt(1)) {
+ assertEquals("two", label)
+ assertEquals("section two", text)
+ }
+ }
+ }
+ }
+
+ Test fun sectionOnOneLine() {
+ verifyModel("test/data/comments/sectionOnOneLine.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(1, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("same line", text)
+ }
+ }
+ }
+ }
+
+ Test fun emptySectionOnOneLine() {
+ verifyModel("test/data/comments/emptySectionOnOneLine.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(1, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("", text)
+ }
+ }
+ }
+ }
+
+ Test fun multilineSection() {
+ verifyModel("test/data/comments/multilineSection.kt") { model ->
+ with(model.nodes.single().members.single()) {
+ assertEquals("Summary", doc.summary)
+ assertEquals(1, doc.sections.count())
+ with (doc.sections.elementAt(0)) {
+ assertEquals("one", label)
+ assertEquals("""line one
+line two""", text)
+ }
+ }
+ }
+ }
}