diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-09-29 20:54:59 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-09-29 20:54:59 +0400 |
commit | 778e2b3f7ff62971e18a49d81a8825e5dd894c2e (patch) | |
tree | f7fb9506800262ecabb9050ffee4a97e39812ccb /test/src/markdown/ParserTest.kt | |
parent | 2e3dc238275073a5c7a2e5a14c79337d12492dad (diff) | |
download | dokka-778e2b3f7ff62971e18a49d81a8825e5dd894c2e.tar.gz dokka-778e2b3f7ff62971e18a49d81a8825e5dd894c2e.tar.bz2 dokka-778e2b3f7ff62971e18a49d81a8825e5dd894c2e.zip |
Extract content model, make doc model independent from descriptors, parse doccomments with custom parser, some tests failing due to hanging new lines.
Diffstat (limited to 'test/src/markdown/ParserTest.kt')
-rw-r--r-- | test/src/markdown/ParserTest.kt | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/test/src/markdown/ParserTest.kt b/test/src/markdown/ParserTest.kt index 726505cf..2a310bb2 100644 --- a/test/src/markdown/ParserTest.kt +++ b/test/src/markdown/ParserTest.kt @@ -3,13 +3,13 @@ package org.jetbrains.dokka.tests import org.junit.Test import org.jetbrains.dokka import org.jetbrains.dokka.MarkdownProcessor -import org.jetbrains.dokka.dump +import org.jetbrains.dokka.toTestString import org.jetbrains.dokka.toHtml public class ParserTest { fun runTestFor(text : String) { - val markdownTree = MarkdownProcessor().parse(text) - println(markdownTree.dump()) + val markdownTree = MarkdownProcessor.parse(text) + println(markdownTree.toTestString()) println(markdownTree.toHtml()) } @@ -79,5 +79,37 @@ number two Test fun emph() { runTestFor("*text*") } + + Test fun emphAndEmptySection() { + runTestFor("*text* \$sec:") + } + + Test fun emphAndSection() { + runTestFor("*text* \$sec: some text") + } + + Test fun emphAndBracedSection() { + runTestFor("Text *bold* text \${sec}: some text") + } + + Test fun section() { + runTestFor( + "Plain text \$one: Summary \${two}: Description with *emphasis* \${An example of a section}: Example") + } + + Test fun anonymousSection() { + runTestFor("Summary\n\nDescription\n") + } + + Test fun specialSection() { + runTestFor( + "Plain text \$\$summary: Summary \${\$description}: Description \${\$An example of a section}: Example") + } + + Test fun emptySection() { + runTestFor( + "Plain text \$summary:") + } + } |