diff options
Diffstat (limited to 'plugins/javadoc')
6 files changed, 17 insertions, 5 deletions
diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 97e3a046..462e966f 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -18,7 +18,6 @@ dependencies { implementation(libs.kotlinx.coroutines.core) testImplementation(projects.plugins.base.baseTestUtils) - testImplementation(projects.testUtils) testImplementation(projects.core.testApi) testImplementation(libs.jsoup) diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/Asserts.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/Asserts.kt new file mode 100644 index 00000000..9f48b1db --- /dev/null +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/Asserts.kt @@ -0,0 +1,17 @@ +package org.jetbrains.dokka.javadoc + +import kotlin.contracts.* + +// TODO replace with assertIs<T> from kotlin-test as part of #2924 +@OptIn(ExperimentalContracts::class) +inline fun <reified T> assertIsInstance(obj: Any?): T { + contract { + returns() implies (obj is T) + } + + if (obj is T) { + return obj + } + + throw AssertionError("Expected instance of type ${T::class.qualifiedName} but found $obj") +} diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt index f62c1886..6bfd068a 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt @@ -4,7 +4,6 @@ import org.jetbrains.dokka.javadoc.pages.AllClassesPage import org.jetbrains.dokka.javadoc.pages.LinkJavadocListEntry import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentKind -import org.jetbrains.dokka.test.assertIsInstance import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt index 0f8d7e79..65fbd30f 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka.javadoc import org.jetbrains.dokka.javadoc.pages.JavadocClasslikePageNode import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test -import org.jetbrains.dokka.test.assertIsInstance internal class JavadocClasslikeTemplateMapTest : AbstractJavadocTemplateMapTest() { diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocModuleTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocModuleTemplateMapTest.kt index f6b8439f..b647cd6e 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocModuleTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocModuleTemplateMapTest.kt @@ -3,7 +3,6 @@ package org.jetbrains.dokka.javadoc import org.jetbrains.dokka.javadoc.pages.JavadocModulePageNode import org.jetbrains.dokka.javadoc.pages.RowJavadocListEntry import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.test.assertIsInstance import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import java.io.File diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt index 4a761ca6..a02b01fa 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt @@ -4,7 +4,6 @@ import org.jetbrains.dokka.javadoc.pages.JavadocContentKind import org.jetbrains.dokka.javadoc.pages.JavadocPackagePageNode import org.jetbrains.dokka.javadoc.pages.RowJavadocListEntry import org.jetbrains.dokka.links.DRI -import org.jetbrains.dokka.test.assertIsInstance import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test import java.io.File |