From 1f592a7ec2786e0a0b77d224d1414ef3042caae4 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 20 Jan 2021 10:41:48 +0100 Subject: Annotations for parameters (#1704) --- plugins/base/src/test/kotlin/utils/ModelUtils.kt | 1 + plugins/base/src/test/kotlin/utils/TestUtils.kt | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'plugins/base/src/test/kotlin/utils') 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?.allEquals(other: Any?) = this?.also { c -> c.forEach { it equals other } } ?: run { assert(false) { "Collection is empty" } } infix fun Collection?.exists(e: T) { @@ -35,10 +36,6 @@ interface AssertDSL { fun Collection.assertCount(n: Int, prefix: String = "") = assert(count() == n) { "${prefix}Expected $n, got ${count()}" } - - fun T?.assertEqual(expected: T, prefix: String = "") = assert(this == expected) { - "${prefix}Expected $expected, got $this" - } } inline fun Any?.assertIsInstance(name: String): T = -- cgit