aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/src
diff options
context:
space:
mode:
Diffstat (limited to 'integration-tests/src')
-rw-r--r--integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt10
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
)
}