aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt16
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt13
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt21
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt (renamed from plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt)2
4 files changed, 45 insertions, 7 deletions
diff --git a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
index ea2c434f..b2cfe176 100644
--- a/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/AndroidExternalLocationProviderTest.kt
@@ -86,4 +86,20 @@ class AndroidExternalLocationProviderTest : AbstractCoreTest() {
locationProvider.resolve(dri)
)
}
+
+ @Test
+ fun `should return null for method not in list`() {
+ val locationProvider = getTestLocationProvider(android)
+ val dri = DRI(
+ "foo",
+ "Bar",
+ Callable(
+ "baz",
+ null,
+ emptyList()
+ )
+ )
+
+ assertEquals(null, locationProvider.resolve(dri))
+ }
}
diff --git a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
index bfa60d24..7d21e0a7 100644
--- a/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/DefaultExternalLocationProviderTest.kt
@@ -1,6 +1,5 @@
package locationProvider
-import org.jetbrains.dokka.ExternalDocumentationLink
import org.jetbrains.dokka.base.resolvers.external.DefaultExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
@@ -23,7 +22,6 @@ class DefaultExternalLocationProviderTest : AbstractCoreTest() {
sourceSet {
sourceRoots = listOf("src/")
classpath += jvmStdlibPath!!
- ExternalDocumentationLink(kotlinLang, packageListURL.toString())
}
}
}
@@ -62,4 +60,15 @@ class DefaultExternalLocationProviderTest : AbstractCoreTest() {
assertEquals("$kotlinLang/kotlin-stdlib/[JS root]/long-array.html", locationProvider.resolve(dri))
}
+
+ @Test
+ fun `should return null for class not in list`() {
+ val locationProvider = getTestLocationProvider()
+ val dri = DRI(
+ "foo",
+ "Bar"
+ )
+
+ assertEquals(null, locationProvider.resolve(dri))
+ }
}
diff --git a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
index 31ffa0b3..165c7c15 100644
--- a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
@@ -1,15 +1,13 @@
package locationProvider
-import org.jetbrains.dokka.ExternalDocumentationLink
import org.jetbrains.dokka.base.resolvers.external.Dokka010ExternalLocationProvider
-import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
import org.jetbrains.dokka.links.Callable
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.TypeConstructor
+import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
-import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import java.net.URL
@@ -24,7 +22,6 @@ class Dokka010ExternalLocationProviderTest : AbstractCoreTest() {
sourceSet {
sourceRoots = listOf("src/")
classpath += jvmStdlibPath!!
- ExternalDocumentationLink(kotlinLang, packageListURL.toString())
}
}
}
@@ -103,4 +100,20 @@ class Dokka010ExternalLocationProviderTest : AbstractCoreTest() {
assertEquals("$kotlinLang/kotlin/-int/max-value.html", locationProvider.resolve(dri))
}
+
+ @Test
+ fun `should return null for method not in list`() {
+ val locationProvider = getTestLocationProvider()
+ val dri = DRI(
+ "foo",
+ "Bar",
+ Callable(
+ "baz",
+ null,
+ emptyList()
+ )
+ )
+
+ assertEquals(null, locationProvider.resolve(dri))
+ }
}
diff --git a/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt
index 6426c0e1..b35310a5 100644
--- a/plugins/base/src/test/kotlin/locationProvider/DefaultLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/DokkaLocationProviderTest.kt
@@ -1,8 +1,8 @@
package locationProvider
-import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.base.resolvers.local.DokkaLocationProvider
import org.jetbrains.dokka.model.dfs
+import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.testApi.testRunner.AbstractCoreTest
import org.junit.jupiter.api.Assertions.assertNotEquals
import org.junit.jupiter.api.Test