From 778e2b3f7ff62971e18a49d81a8825e5dd894c2e Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Mon, 29 Sep 2014 20:54:59 +0400 Subject: Extract content model, make doc model independent from descriptors, parse doccomments with custom parser, some tests failing due to hanging new lines. --- test/src/markdown/ParserTest.kt | 38 +++++++++++++++++++++++++++++++++++--- test/src/markdown/Specification.kt | 2 +- 2 files changed, 36 insertions(+), 4 deletions(-) (limited to 'test/src/markdown') 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:") + } + } diff --git a/test/src/markdown/Specification.kt b/test/src/markdown/Specification.kt index e0cda024..ba1f8363 100644 --- a/test/src/markdown/Specification.kt +++ b/test/src/markdown/Specification.kt @@ -4,7 +4,7 @@ import org.junit.runner.* import org.jetbrains.kmark.test.* import org.jetbrains.dokka.* -[RunWith(javaClass())] +//[RunWith(javaClass())] class Specification : MarkdownSpecification("test/data/markdown/spec.txt", { markdownToHtml(it.replace("→", "\t")) }) \ No newline at end of file -- cgit