diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-09-10 13:43:53 +0200 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-09-10 13:43:53 +0200 |
commit | 8050cf6b6f7205a44ad0adebeaa19e202607f91d (patch) | |
tree | b5ab9e9ab2df2654fb93f3b49b8208a8c712d257 /test | |
parent | aace0f39335c7428ffcfd44cbe1371ecc32ddd08 (diff) | |
download | dokka-8050cf6b6f7205a44ad0adebeaa19e202607f91d.tar.gz dokka-8050cf6b6f7205a44ad0adebeaa19e202607f91d.tar.bz2 dokka-8050cf6b6f7205a44ad0adebeaa19e202607f91d.zip |
fix package docs parsing, add test
Diffstat (limited to 'test')
-rw-r--r-- | test/data/packagedocs/stdlib.md | 11 | ||||
-rw-r--r-- | test/src/format/PackageDocsTest.kt | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/test/data/packagedocs/stdlib.md b/test/data/packagedocs/stdlib.md new file mode 100644 index 00000000..5d7432b5 --- /dev/null +++ b/test/data/packagedocs/stdlib.md @@ -0,0 +1,11 @@ +# Module stdlib + +## Kotlin Standard Library + +The Kotlin standard library is a set of functions and types implementing idiomatic patterns when working with collections, +text and files. + +# Package kotlin + +Core functions and types + diff --git a/test/src/format/PackageDocsTest.kt b/test/src/format/PackageDocsTest.kt new file mode 100644 index 00000000..6815de6f --- /dev/null +++ b/test/src/format/PackageDocsTest.kt @@ -0,0 +1,18 @@ +package org.jetbrains.dokka.tests.format + +import org.jetbrains.dokka.ContentBlock +import org.jetbrains.dokka.ContentText +import org.jetbrains.dokka.DokkaConsoleLogger +import org.jetbrains.dokka.PackageDocs +import org.junit.Test +import kotlin.test.assertEquals + +public class PackageDocsTest { + @Test fun verifyParse() { + val docs = PackageDocs(null, null, DokkaConsoleLogger) + docs.parse("test/data/packagedocs/stdlib.md") + val packageContent = docs.packageContent["kotlin"]!! + val block = (packageContent.children.single() as ContentBlock).children.first() as ContentText + assertEquals("Core functions and types", block.text) + } +} |