aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-08-21 12:51:34 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-21 18:38:10 +0200
commit8b0b4604f834ac5edd4f9569647fdfd0a966e768 (patch)
treeea22c2da1a764c1b296a4df70d69e63d61c9377b /plugins/base/src/test/kotlin
parentf2635289b1923866843e1dd47423bd6ca74c2cb1 (diff)
downloaddokka-8b0b4604f834ac5edd4f9569647fdfd0a966e768.tar.gz
dokka-8b0b4604f834ac5edd4f9569647fdfd0a966e768.tar.bz2
dokka-8b0b4604f834ac5edd4f9569647fdfd0a966e768.zip
Fix linking to declarations in companion objects in old dokka formats
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt32
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
index 1a2a45d7..31ffa0b3 100644
--- a/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
+++ b/plugins/base/src/test/kotlin/locationProvider/Dokka010ExternalLocationProviderTest.kt
@@ -71,4 +71,36 @@ class Dokka010ExternalLocationProviderTest : AbstractCoreTest() {
assertEquals("$kotlinLang/kotlin/java.math.-big-decimal/minus.html", locationProvider.resolve(dri))
}
+
+ @Test
+ fun `#1268 companion part should be stripped`() {
+ val locationProvider = getTestLocationProvider()
+ val dri = DRI(
+ "kotlin",
+ "Int.Companion",
+ Callable(
+ "MIN_VALUE",
+ null,
+ emptyList()
+ )
+ )
+
+ assertEquals("$kotlinLang/kotlin/-int/-m-i-n_-v-a-l-u-e.html", locationProvider.resolve(dri))
+ }
+
+ @Test
+ fun `companion part should be stripped in relocations`() {
+ val locationProvider = getTestLocationProvider()
+ val dri = DRI(
+ "kotlin",
+ "Int.Companion",
+ Callable(
+ "MAX_VALUE",
+ null,
+ emptyList()
+ )
+ )
+
+ assertEquals("$kotlinLang/kotlin/-int/max-value.html", locationProvider.resolve(dri))
+ }
}