aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/data/packagedocs/stdlib.md11
-rw-r--r--test/src/format/PackageDocsTest.kt18
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)
+ }
+}