aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-03-19 11:30:25 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-03-19 12:42:00 +0100
commitca94b6e7a037d746d895de7919a65fb42558601a (patch)
tree7995a1bea7028aad0de89759743bbf02aea087e3
parentb9f426a65f7b98a678478222646a23f10425681f (diff)
downloaddokka-ca94b6e7a037d746d895de7919a65fb42558601a.tar.gz
dokka-ca94b6e7a037d746d895de7919a65fb42558601a.tar.bz2
dokka-ca94b6e7a037d746d895de7919a65fb42558601a.zip
Fix companionObjectTest
-rw-r--r--plugins/base/src/test/kotlin/model/ClassesTest.kt22
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