diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-26 14:49:31 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-31 15:10:04 +0200 |
commit | 855718815ff58660a965b29247137355e67160c9 (patch) | |
tree | 82884ed2efc89adf3e44a22f3b24813238bb9e39 /plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt | |
parent | 9bf535bf8c0b758fc0abf99b61208fa5430239d6 (diff) | |
download | dokka-855718815ff58660a965b29247137355e67160c9.tar.gz dokka-855718815ff58660a965b29247137355e67160c9.tar.bz2 dokka-855718815ff58660a965b29247137355e67160c9.zip |
WIP
Diffstat (limited to 'plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt')
-rw-r--r-- | plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt b/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt index 5c0a0646..17f9631a 100644 --- a/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt +++ b/plugins/base/src/test/kotlin/parsers/ParseModuleAndPackageDocumentationFragmentsTest.kt @@ -76,21 +76,24 @@ class ParseModuleAndPackageDocumentationFragmentsTest { } @Test - fun `no package name specified fails`() { - val exception = assertThrows<IllegalModuleAndPackageDocumentation> { - parseModuleAndPackageDocumentationFragments( - source( - """ - # Package - No package name given - """.trimIndent() - ) - ) - } + fun `no package name specified does not fail`() { + val source = source( + """ + # Package + This is a root package + """.trimIndent() + ) + val fragments = parseModuleAndPackageDocumentationFragments(source) + assertEquals(1, fragments.size, "Expected a single package fragment") - assertTrue( - "Missing Package name" in exception.message.orEmpty(), - "Expected 'Missing Package name' in error message" + assertEquals( + ModuleAndPackageDocumentationFragment( + name = "", + classifier = Package, + documentation = "This is a root package", + source = source + ), + fragments.single() ) } |