aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/src/main
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-09-08 00:13:55 +0200
committerBłażej Kardyś <bkardys@virtuslab.com>2020-09-30 13:43:08 +0200
commitdafa895f8c683973cc6050327fb01729fc53f467 (patch)
treefcfb810fecdbcf621644511a29a6c6c97c897621 /integration-tests/src/main
parentf8e1428a3235dae9fca9faaa4837313693d6456f (diff)
downloaddokka-dafa895f8c683973cc6050327fb01729fc53f467.tar.gz
dokka-dafa895f8c683973cc6050327fb01729fc53f467.tar.bz2
dokka-dafa895f8c683973cc6050327fb01729fc53f467.zip
Add integration test for linking between projects
Diffstat (limited to 'integration-tests/src/main')
-rw-r--r--integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt13
1 files changed, 9 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 2a01993e..7c08b534 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
@@ -6,6 +6,7 @@ import org.junit.rules.TemporaryFolder
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import java.io.File
+import java.net.URL
import kotlin.test.assertFalse
import kotlin.test.assertTrue
@@ -69,15 +70,19 @@ abstract class AbstractIntegrationTest {
hrefSplits.first()
} else href
- val targetFile = File(file.parent, hrefWithoutAnchors)
+ val targetFile = if (href.startsWith("file")) {
+ File(URL(hrefWithoutAnchors).path)
+ } else {
+ File(file.parent, hrefWithoutAnchors)
+ }
+
if (targetFile.extension.isNotEmpty() && targetFile.extension !in fileExtensions) return@forEach
- if (
- targetFile.extension.isEmpty() || targetFile.extension == "html" && !href.startsWith("#")) {
+ if (targetFile.extension.isEmpty() || targetFile.extension == "html" && !href.startsWith("#")) {
assertTrue(
targetFile.exists(),
"${file.relativeTo(projectDir).path}: href=\"$href\"\n" +
- "file does not exist: ${targetFile.relativeTo(projectDir).path}"
+ "file does not exist: ${targetFile.path}"
)
}
}