From f941d6adefa71d2b3b1cc69120edf7eae70187ba Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Fri, 6 Oct 2017 14:14:09 +0100 Subject: Add new "suppress" per-package option. --- core/src/test/kotlin/model/PackageTest.kt | 35 ++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'core/src/test/kotlin/model/PackageTest.kt') 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()) + } + } + } +} -- cgit