From 8c218ff4dd5f970233c43845c19299fc74256389 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 29 Apr 2022 15:03:08 +0300 Subject: Enable warnings as errors and fix all warnings (#2451) * Enable warnings as errors and fix all warnings * Enable skip-metadata-version-check compiler setting --- .../org/jetbrains/dokka/javadoc/JavadocClasslikeTemplateMapTest.kt | 2 ++ .../test/kotlin/org/jetbrains/dokka/javadoc/JavadocDeprecatedTest.kt | 3 +++ .../src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt | 3 +++ .../org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt | 2 ++ 4 files changed, 10 insertions(+) (limited to 'plugins/javadoc/src/test/kotlin') 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 10240a3f..0f8d7e79 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 @@ -351,8 +351,10 @@ internal class JavadocClasslikeTemplateMapTest : AbstractJavadocTemplateMapTest( private fun Map.signatureWithModifiers(): String = "${modifiers()} ${signatureWithoutModifiers()}" + @Suppress("UNCHECKED_CAST") private fun Map.signatureWithoutModifiers(): String = (get("signature") as Map)["signatureWithoutModifiers"] as String + @Suppress("UNCHECKED_CAST") private fun Map.modifiers(): String = (get("signature") as Map)["modifiers"] as String } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocDeprecatedTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocDeprecatedTest.kt index 982d356a..e2331f58 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocDeprecatedTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocDeprecatedTest.kt @@ -10,6 +10,7 @@ internal class JavadocDeprecatedTest : AbstractJavadocTemplateMapTest() { @Test fun `generates correct number of sections`() { testDeprecatedPageTemplateMaps { templateMap -> + @Suppress("UNCHECKED_CAST") Assertions.assertEquals(6, (templateMap["sections"] as List).size) } } @@ -164,9 +165,11 @@ internal class JavadocDeprecatedTest : AbstractJavadocTemplateMapTest() { operation(firstPageOfType().templateMap) } + @Suppress("UNCHECKED_CAST") private fun TemplateMap.section(name: String) = (this["sections"] as List).first { it["caption"] == name } + @Suppress("UNCHECKED_CAST") private fun TemplateMap.elements() = this["elements"] as List } \ No newline at end of file diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt index 801213c2..76c345b0 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt @@ -28,6 +28,7 @@ internal class JavadocIndexTest : AbstractJavadocTemplateMapTest() { @Test fun `templateMap for class index`() { testIndexPagesTemplateMaps { templateMaps -> + @Suppress("UNCHECKED_CAST") val element = (templateMaps[2]["elements"] as List)[1] assertEquals("../package0/ClassA.html", element["address"]) assertEquals("ClassA", element["name"]) @@ -41,6 +42,7 @@ internal class JavadocIndexTest : AbstractJavadocTemplateMapTest() { @Test fun `templateMap for enum entry index`() { testIndexPagesTemplateMaps { templateMaps -> + @Suppress("UNCHECKED_CAST") val element = (templateMaps[0]["elements"] as List).last() assertEquals("../package1/ClassCEnum.html#A", element["address"]) assertEquals("A", element["name"]) @@ -54,6 +56,7 @@ internal class JavadocIndexTest : AbstractJavadocTemplateMapTest() { @Test fun `templateMap for function index`() { testIndexPagesTemplateMaps { templateMaps -> + @Suppress("UNCHECKED_CAST") val element = (templateMaps[0]["elements"] as List).first() assertEquals("../package0/ClassA.html#a()", element["address"]) assertEquals("a()", element["name"]) 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 356e5772..592d7b0d 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 @@ -13,6 +13,7 @@ import java.io.File internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest() { @Test + @Suppress("UNCHECKED_CAST") fun `single class`() { dualTestTemplateMapInline( kotlin = @@ -44,6 +45,7 @@ internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest() } @Test + @Suppress("UNCHECKED_CAST") fun `multiple packages`() { dualTestTemplateMapInline( kotlin = -- cgit