aboutsummaryrefslogtreecommitdiff
path: root/test/src/model
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-01-30 17:59:15 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-01-30 17:59:15 +0100
commitbfd9ffd13ed6b6916790f5f0de5f9523db71b22e (patch)
tree214ae0ff76e8b35841947b639ce3c2022ad72fec /test/src/model
parentb55b258574a01a02f906f5f12646ecacfc640e20 (diff)
downloaddokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.tar.gz
dokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.tar.bz2
dokka-bfd9ffd13ed6b6916790f5f0de5f9523db71b22e.zip
load sections from KDoc PSI, not through Markdown extensions
Diffstat (limited to 'test/src/model')
-rw-r--r--test/src/model/CommentTest.kt45
1 files changed, 9 insertions, 36 deletions
diff --git a/test/src/model/CommentTest.kt b/test/src/model/CommentTest.kt
index 828deaa4..353336d6 100644
--- a/test/src/model/CommentTest.kt
+++ b/test/src/model/CommentTest.kt
@@ -67,8 +67,8 @@ public class CommentTest {
verifyModel("test/data/comments/emptySection.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
- assertEquals(2, content.sections.count())
- with (content.sections["one"]!!) {
+ assertEquals(1, content.sections.count())
+ with (content.findSectionByName("one")!!) {
assertEquals("one", label)
assertEquals("", toTestString())
}
@@ -76,22 +76,12 @@ public class CommentTest {
}
}
- Test fun explicitSummary() {
- verifyModel("test/data/comments/explicitSummary.kt") { model ->
- with(model.members.single().members.single()) {
- assertEquals("Summary", content.summary.toTestString())
- assertEquals("Description", content.description.toTestString())
- assertEquals(2, content.sections.count())
- }
- }
- }
-
Test fun section1() {
verifyModel("test/data/comments/section1.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
- assertEquals(2, content.sections.count())
- with (content.sections["one"]!!) {
+ assertEquals(1, content.sections.count())
+ with (content.findSectionByName("one")!!) {
assertEquals("one", label)
assertEquals("section one", toTestString())
}
@@ -103,12 +93,12 @@ public class CommentTest {
verifyModel("test/data/comments/section2.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
- assertEquals(3, content.sections.count())
- with (content.sections["one"]!!) {
+ assertEquals(2, content.sections.count())
+ with (content.findSectionByName("one")!!) {
assertEquals("one", label)
assertEquals("section one", toTestString())
}
- with (content.sections["two"]!!) {
+ with (content.findSectionByName("two")!!) {
assertEquals("two", label)
assertEquals("section two", toTestString())
}
@@ -120,8 +110,8 @@ public class CommentTest {
verifyModel("test/data/comments/multilineSection.kt") { model ->
with(model.members.single().members.single()) {
assertEquals("Summary", content.summary.toTestString())
- assertEquals(2, content.sections.count())
- with (content.sections["one"]!!) {
+ assertEquals(1, content.sections.count())
+ with (content.findSectionByName("one")!!) {
assertEquals("one", label)
assertEquals("""line one
line two""", toTestString())
@@ -130,43 +120,26 @@ line two""", toTestString())
}
}
- Test fun sectionWithBracedLabel() {
- verifyModel("test/data/comments/sectionWithBracedLabel.kt") { model ->
- with(model.members.single().members.single()) {
- assertEquals("Summary", content.summary.toTestString())
- assertEquals(2, content.sections.count())
- with (content.sections["this.label.is.really.long"]!!) {
- assertEquals("this.label.is.really.long", label)
- assertEquals("section one", 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) {
assertEqualsIgnoringSeparators("""[code]
if (true) {
println(property)
}
[/code]
-
[code]
if (true) {
println(property)
}
[/code]
-
[code]
if (true) {
println(property)
}
[/code]
-
[code]
if (true) {
println(property)