diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-08-14 13:38:36 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-19 13:34:10 +0200 |
commit | a547235b41cb3c5d8a2dfb50923bf1ec2d3cd620 (patch) | |
tree | 0528e91a2134d440cda1e781540c5264d53ced4b /integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka | |
parent | 97275264d7c39afde6c6a1511e7ad499430ca594 (diff) | |
download | dokka-a547235b41cb3c5d8a2dfb50923bf1ec2d3cd620.tar.gz dokka-a547235b41cb3c5d8a2dfb50923bf1ec2d3cd620.tar.bz2 dokka-a547235b41cb3c5d8a2dfb50923bf1ec2d3cd620.zip |
Implement ignoring known unresolved links in integration tests
Diffstat (limited to 'integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka')
-rw-r--r-- | integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt index c24ca75b..c13fcf14 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt @@ -64,7 +64,7 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst htmlOutputDir.allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLinksIgnoringKnown(file) + assertNoUnresolvedLinks(file, knownUnresolvedDRIs) assertNoHrefToMissingLocalFileOrDirectory(file) assertNoEmptyLinks(file) } @@ -89,21 +89,11 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst } } - // TODO: use [assertNoUnresolvedLinks] instead when https://github.com/Kotlin/dokka/issues/1306 is closed - private fun assertNoUnresolvedLinksIgnoringKnown(file: File) { - val knownUnresolvedDRIs = setOf( + // TODO: remove this list when https://github.com/Kotlin/dokka/issues/1306 is closed + private val knownUnresolvedDRIs = setOf( "it.android/IntegrationTestActivity/findViewById/#kotlin.Int/PointingToGenericParameters(0)/", "it.android/IntegrationTestActivity/getExtraData/#java.lang.Class[TypeParam(bounds=[androidx.core.app.ComponentActivity.ExtraData])]/PointingToGenericParameters(0)/", "it.android/IntegrationTestActivity/getSystemService/#java.lang.Class[TypeParam(bounds=[kotlin.Any])]/PointingToGenericParameters(0)/", "it.android/IntegrationTestActivity/requireViewById/#kotlin.Int/PointingToGenericParameters(0)/" ) - val fileText = file.readText() - val regex = Regex("""data-unresolved-link="\[(.+?(?=]"))""") - val match = regex.findAll(fileText).map { it.groups[1]!!.value } - - assertTrue( - match.filterNot { it in knownUnresolvedDRIs }.toList().isEmpty(), - "Unexpected unresolved link in ${file.path}\n" + fileText - ) - } } |