diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-01-20 10:41:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 10:41:48 +0100 |
commit | 1f592a7ec2786e0a0b77d224d1414ef3042caae4 (patch) | |
tree | 71d2ec07325d505d2c1b78a71720ddc825b2b87c /plugins/base/src/test/kotlin/utils | |
parent | 93520158b4be59f98015d07e8fecaa7e5a49fd99 (diff) | |
download | dokka-1f592a7ec2786e0a0b77d224d1414ef3042caae4.tar.gz dokka-1f592a7ec2786e0a0b77d224d1414ef3042caae4.tar.bz2 dokka-1f592a7ec2786e0a0b77d224d1414ef3042caae4.zip |
Annotations for parameters (#1704)
Diffstat (limited to 'plugins/base/src/test/kotlin/utils')
-rw-r--r-- | plugins/base/src/test/kotlin/utils/ModelUtils.kt | 1 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/utils/TestUtils.kt | 9 |
2 files changed, 4 insertions, 6 deletions
diff --git a/plugins/base/src/test/kotlin/utils/ModelUtils.kt b/plugins/base/src/test/kotlin/utils/ModelUtils.kt index 87a9c802..24bf87c0 100644 --- a/plugins/base/src/test/kotlin/utils/ModelUtils.kt +++ b/plugins/base/src/test/kotlin/utils/ModelUtils.kt @@ -20,6 +20,7 @@ abstract class AbstractModelTest(val path: String? = null, val pkg: String) : Mo sourceSet { sourceRoots = listOf("src/") analysisPlatform = platform + classpath += jvmStdlibPath!! } } } diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index 036599c9..a0528acd 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -1,9 +1,10 @@ package utils +import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.doc.P -import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest +import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertTrue import kotlin.collections.orEmpty @@ -21,7 +22,7 @@ abstract class ModelDSL : BaseAbstractTest() { @TestDSL interface AssertDSL { - infix fun Any?.equals(other: Any?) = this.assertEqual(other) + infix fun Any?.equals(other: Any?) = assertEquals(other, this) infix fun Collection<Any>?.allEquals(other: Any?) = this?.also { c -> c.forEach { it equals other } } ?: run { assert(false) { "Collection is empty" } } infix fun <T> Collection<T>?.exists(e: T) { @@ -35,10 +36,6 @@ interface AssertDSL { fun <T> Collection<T>.assertCount(n: Int, prefix: String = "") = assert(count() == n) { "${prefix}Expected $n, got ${count()}" } - - fun <T> T?.assertEqual(expected: T, prefix: String = "") = assert(this == expected) { - "${prefix}Expected $expected, got $this" - } } inline fun <reified T : Any> Any?.assertIsInstance(name: String): T = |