aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc/src/test/kotlin/org
diff options
context:
space:
mode:
authorVsevolod Tolstopyatov <qwwdfsad@gmail.com>2023-03-27 03:01:34 -0700
committerGitHub <noreply@github.com>2023-03-27 13:01:34 +0300
commit9af0b307a14253a21d11d340a78dd9061abee359 (patch)
treecbd2af142d1833b32f657a2eb6b8ed7b6ba0e510 /plugins/javadoc/src/test/kotlin/org
parentb9e9962f75bfd6b19c16eccf7d4d6608b8f5db1e (diff)
downloaddokka-9af0b307a14253a21d11d340a78dd9061abee359.tar.gz
dokka-9af0b307a14253a21d11d340a78dd9061abee359.tar.bz2
dokka-9af0b307a14253a21d11d340a78dd9061abee359.zip
Mark utilities.* API as Dokka-internal (#2937)
* Deprecate unused declaration, remove inline declaration (as it's binary compatible), opt-in into internal API at project level * Opt-in into DokkaInternalApi where applicable * Get rid of intermediate test-utils module
Diffstat (limited to 'plugins/javadoc/src/test/kotlin/org')
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/Asserts.kt17
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt1
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt1
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocModuleTemplateMapTest.kt1
-rw-r--r--plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt1
5 files changed, 17 insertions, 4 deletions
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