aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/utils/TestUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/utils/TestUtils.kt')
-rw-r--r--plugins/base/src/test/kotlin/utils/TestUtils.kt14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt
index bf86c1b1..68ab7120 100644
--- a/plugins/base/src/test/kotlin/utils/TestUtils.kt
+++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt
@@ -1,9 +1,9 @@
package utils
-import org.jetbrains.dokka.model.DClass
-import org.jetbrains.dokka.model.Documentable
+import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
+import kotlin.collections.orEmpty
@DslMarker
annotation class TestDSL
@@ -61,4 +61,12 @@ fun <T> T?.assertNotNull(name: String = ""): T = this ?: throw AssertionError("$
fun <T : Documentable> T?.docs() = this?.documentation.orEmpty().values.flatMap { it.children }
val DClass.supers
- get() = supertypes.flatMap{it.component2()} \ No newline at end of file
+ get() = supertypes.flatMap { it.component2() }
+
+val Bound.name: String?
+ get() = when (this) {
+ is Nullable -> inner.name
+ is OtherParameter -> name
+ is PrimitiveJavaType -> name
+ is TypeConstructor -> dri.classNames
+ } \ No newline at end of file