From 56ff8f3f24209bc9edaece876c56bd3fde1fbf8a Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 2 Sep 2022 17:44:05 +0200 Subject: Underline `@param` tag key for more consistency (#2643) * Underline `@param` tag key for more consistency * Correct keyValue table column ratio --- plugins/base/src/test/kotlin/utils/TestUtils.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'plugins/base/src/test/kotlin/utils') diff --git a/plugins/base/src/test/kotlin/utils/TestUtils.kt b/plugins/base/src/test/kotlin/utils/TestUtils.kt index e4bc4a1e..8cb126d5 100644 --- a/plugins/base/src/test/kotlin/utils/TestUtils.kt +++ b/plugins/base/src/test/kotlin/utils/TestUtils.kt @@ -7,6 +7,7 @@ import org.jetbrains.dokka.model.doc.P import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertTrue import kotlin.collections.orEmpty +import kotlin.test.asserter @DslMarker annotation class TestDSL @@ -38,6 +39,16 @@ interface AssertDSL { assert(count() == n) { "${prefix}Expected $n, got ${count()}" } } +/* + * TODO replace with kotlin.test.assertContains after migrating to Kotlin 1.5+ + */ +internal fun assertContains(iterable: Iterable, element: T, ) { + asserter.assertTrue( + { "Expected the collection to contain the element.\nCollection <$iterable>, element <$element>." }, + iterable.contains(element) + ) +} + inline fun Any?.assertIsInstance(name: String): T = this.let { it as? T } ?: throw AssertionError("$name should not be null") -- cgit