aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/model/PackageTest.kt
diff options
context:
space:
mode:
authorChris Rankin <chris.rankin@r3.com>2017-10-06 14:14:09 +0100
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-11-22 21:54:14 +0300
commitf941d6adefa71d2b3b1cc69120edf7eae70187ba (patch)
tree0b943db512486c5cb39e0d3d59c3984090cf5c33 /core/src/test/kotlin/model/PackageTest.kt
parent2a62816f1a50f03927dad34eb0ee80a889cb9e7e (diff)
downloaddokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.tar.gz
dokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.tar.bz2
dokka-f941d6adefa71d2b3b1cc69120edf7eae70187ba.zip
Add new "suppress" per-package option.
Diffstat (limited to 'core/src/test/kotlin/model/PackageTest.kt')
-rw-r--r--core/src/test/kotlin/model/PackageTest.kt35
1 files changed, 32 insertions, 3 deletions
diff --git a/core/src/test/kotlin/model/PackageTest.kt b/core/src/test/kotlin/model/PackageTest.kt
index 97810e80..052f0d28 100644
--- a/core/src/test/kotlin/model/PackageTest.kt
+++ b/core/src/test/kotlin/model/PackageTest.kt
@@ -2,10 +2,10 @@ package org.jetbrains.dokka.tests
import org.jetbrains.dokka.Content
import org.jetbrains.dokka.NodeKind
+import org.jetbrains.dokka.PackageOptionsImpl
import org.jetbrains.kotlin.config.KotlinSourceRoot
+import org.junit.Assert.*
import org.junit.Test
-import org.junit.Assert.assertEquals
-import org.junit.Assert.assertTrue
public class PackageTest {
@Test fun rootPackage() {
@@ -83,4 +83,33 @@ public class PackageTest {
}
}
}
-} \ No newline at end of file
+
+ @Test fun classAtPackageLevel() {
+ verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt")) { model ->
+ assertEquals(1, model.members.count())
+ with(model.members.elementAt(0)) {
+ assertEquals(NodeKind.Package, kind)
+ assertEquals("simple.name", name)
+ assertEquals(Content.Empty, content)
+ assertTrue(details.none())
+ assertEquals(1, members.size)
+ assertTrue(links.none())
+ }
+ }
+ }
+
+ @Test fun suppressAtPackageLevel() {
+ verifyModel(KotlinSourceRoot("testdata/packages/classInPackage.kt"),
+ perPackageOptions = listOf(PackageOptionsImpl(prefix = "simple.name", suppress = true))) { model ->
+ assertEquals(1, model.members.count())
+ with(model.members.elementAt(0)) {
+ assertEquals(NodeKind.Package, kind)
+ assertEquals("simple.name", name)
+ assertEquals(Content.Empty, content)
+ assertTrue(details.none())
+ assertTrue(members.none())
+ assertTrue(links.none())
+ }
+ }
+ }
+}