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/src/main/kotlin/org | |
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/src/main/kotlin/org')
-rw-r--r-- | integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt index c2f4f49b..04ae4a88 100644 --- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt +++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt @@ -42,11 +42,13 @@ abstract class AbstractIntegrationTest { ) } - protected fun assertNoUnresolvedLinks(file: File) { - val regex = Regex("data-unresolved-link") + protected fun assertNoUnresolvedLinks(file: File, exceptions: Set<String> = emptySet()) { val fileText = file.readText() - assertFalse( - fileText.contains(regex), + val regex = Regex("""data-unresolved-link="\[(.+?(?=]"))""") + val match = regex.findAll(fileText).map { it.groups[1]!!.value } + + assertTrue( + match.filterNot { it in exceptions }.toList().isEmpty(), "Unexpected unresolved link in ${file.path}\n" + fileText ) } |