diff options
-rw-r--r-- | plugins/base/src/test/kotlin/model/ClassesTest.kt | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/plugins/base/src/test/kotlin/model/ClassesTest.kt b/plugins/base/src/test/kotlin/model/ClassesTest.kt index 336023da..a7ec861a 100644 --- a/plugins/base/src/test/kotlin/model/ClassesTest.kt +++ b/plugins/base/src/test/kotlin/model/ClassesTest.kt @@ -2,6 +2,7 @@ package model import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.KotlinModifier.* +import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Test import utils.AbstractModelTest import utils.assertNotNull @@ -384,10 +385,28 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class ) { with((this / "classes" / "Klass").cast<DClass>()) { name equals "Klass" + assertNull(companion, "Companion should not be visible by default") + } + } + } + @Test + fun companionObject() { + inlineModelTest( + """ + |class Klass { + | companion object { + | fun fn() {} + | val a = 0 + | } + |} + """ + ) { + with((this / "classes" / "Klass").cast<DClass>()) { + name equals "Klass" with((this / "Companion").cast<DObject>()) { name equals "Companion" - visibility.values allEquals KotlinVisibility.Private + visibility.values allEquals KotlinVisibility.Public with((this / "fn").cast<DFunction>()) { name equals "fn" @@ -440,5 +459,4 @@ class ClassesTest : AbstractModelTest("/src/main/kotlin/classes/Test.kt", "class } } } - }
\ No newline at end of file |