aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/packageList/PackageListTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/packageList/PackageListTest.kt')
-rw-r--r--plugins/base/src/test/kotlin/packageList/PackageListTest.kt69
1 files changed, 0 insertions, 69 deletions
diff --git a/plugins/base/src/test/kotlin/packageList/PackageListTest.kt b/plugins/base/src/test/kotlin/packageList/PackageListTest.kt
deleted file mode 100644
index d6033433..00000000
--- a/plugins/base/src/test/kotlin/packageList/PackageListTest.kt
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
- */
-
-package packageList
-
-import org.jetbrains.dokka.base.renderers.PackageListService
-import org.jetbrains.dokka.base.resolvers.shared.RecognizedLinkFormat
-import kotlin.test.Test
-import kotlin.test.assertEquals
-
-class PackageListTest {
- @Test
- fun `one module package list is created correctly`() {
- val nonStandardLocations = mapOf("//longArrayWithFun/#kotlin.Int#kotlin.Function1[kotlin.Int,kotlin.Long]/PointingToDeclaration/" to "[JS root]/long-array-with-fun.html")
- val modules = mapOf("" to setOf("foo", "bar", "baz"))
- val format = RecognizedLinkFormat.DokkaHtml
- val output = PackageListService.renderPackageList(nonStandardLocations, modules, format.formatName, format.linkExtension)
- val expected = """
- |${'$'}dokka.format:html-v1
- |${'$'}dokka.linkExtension:html
- |${'$'}dokka.location://longArrayWithFun/#kotlin.Int#kotlin.Function1[kotlin.Int,kotlin.Long]/PointingToDeclaration/[JS root]/long-array-with-fun.html
- |bar
- |baz
- |foo
- |""".trimMargin()
- assertEquals(expected, output)
- }
-
- @Test
- fun `multi-module package list is created correctly`() {
- val nonStandardLocations = mapOf("//longArrayWithFun/#kotlin.Int#kotlin.Function1[kotlin.Int,kotlin.Long]/PointingToDeclaration/" to "[JS root]/long-array-with-fun.html")
- val modules = mapOf("moduleA" to setOf("foo", "bar"), "moduleB" to setOf("baz"), "moduleC" to setOf("qux"))
- val format = RecognizedLinkFormat.DokkaHtml
- val output = PackageListService.renderPackageList(nonStandardLocations, modules, format.formatName, format.linkExtension)
- val expected = """
- |${'$'}dokka.format:html-v1
- |${'$'}dokka.linkExtension:html
- |${'$'}dokka.location://longArrayWithFun/#kotlin.Int#kotlin.Function1[kotlin.Int,kotlin.Long]/PointingToDeclaration/[JS root]/long-array-with-fun.html
- |module:moduleA
- |bar
- |foo
- |module:moduleB
- |baz
- |module:moduleC
- |qux
- |""".trimMargin()
- assertEquals(expected, output)
- }
-
- @Test
- fun `empty package set in module`() {
- val nonStandardLocations = emptyMap<String, String>()
- val modules = mapOf("moduleA" to setOf("foo", "bar"), "moduleB" to emptySet(), "moduleC" to setOf("qux"))
- val format = RecognizedLinkFormat.DokkaHtml
- val output = PackageListService.renderPackageList(nonStandardLocations, modules, format.formatName, format.linkExtension)
- val expected = """
- |${'$'}dokka.format:html-v1
- |${'$'}dokka.linkExtension:html
- |
- |module:moduleA
- |bar
- |foo
- |module:moduleC
- |qux
- |""".trimMargin()
- assertEquals(expected, output)
- }
-}