aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/renderers/html
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/renderers/html')
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt32
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt26
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt30
3 files changed, 77 insertions, 11 deletions
diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
index b10202bb..6ceb805b 100644
--- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
@@ -4,15 +4,33 @@ import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.SourceRootImpl
import org.jetbrains.dokka.base.renderers.html.HtmlRenderer
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.model.SourceSetData
import org.jetbrains.dokka.pages.ContentDivergentGroup
import org.junit.jupiter.api.Test
import renderers.*
class DivergentTest : RenderingOnlyTestBase() {
- private val js = SourceSetData("root", "js", "JS", Platform.js, listOf(SourceRootImpl("pl1")))
- private val jvm = SourceSetData("root", "jvm", "JVM", Platform.jvm, listOf(SourceRootImpl("pl1")))
- private val native = SourceSetData("root", "native", "NATIVE", Platform.native, listOf(SourceRootImpl("pl1")))
+ private val js = defaultSourceSet.copy(
+ "root",
+ "JS",
+ "js",
+ analysisPlatform = Platform.js,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
+ private val jvm = defaultSourceSet.copy(
+ "root",
+ "JVM",
+ "jvm",
+
+ analysisPlatform = Platform.jvm,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
+ private val native = defaultSourceSet.copy(
+ "root",
+ "NATIVE",
+ "native",
+ analysisPlatform = Platform.native,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
@Test
fun simpleWrappingCase() {
@@ -178,10 +196,10 @@ class DivergentTest : RenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
- Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("a"))),"a+"),
- Div(Div(Span(Div(Div("JS")))), Div(Div(Div("bd"))),"bd+"),
+ Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("a"))), "a+"),
+ Div(Div(Span(Div(Div("JS")))), Div(Div(Div("bd"))), "bd+"),
Div(Div(Span(Div(Div("JVM")))), Div(Div(Div("c")))),
- Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("e"))),"e+"),
+ Div(Div(Span(Div(Div("NATIVE")))), Div(Div(Div("e"))), "e+"),
)
}
diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt
index 878f442b..c868cfd5 100644
--- a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt
@@ -3,7 +3,6 @@ package renderers.html
import org.jetbrains.dokka.Platform
import org.jetbrains.dokka.SourceRootImpl
import org.jetbrains.dokka.base.renderers.html.HtmlRenderer
-import org.jetbrains.dokka.model.SourceSetData
import org.jetbrains.dokka.pages.TextStyle
import org.junit.jupiter.api.Test
import renderers.Div
@@ -12,9 +11,28 @@ import renderers.TestPage
import renderers.match
class SourceSetDependentHintTest : RenderingOnlyTestBase() {
- private val pl1 = SourceSetData("root", "pl1", "pl3",Platform.js, listOf(SourceRootImpl("pl1")))
- private val pl2 = SourceSetData("root","pl2", "pl3", Platform.jvm, listOf(SourceRootImpl("pl1")))
- private val pl3 = SourceSetData("root","pl3", "pl3", Platform.native, listOf(SourceRootImpl("pl1")))
+
+ private val pl1 = defaultSourceSet.copy(
+ "root",
+ "pl1",
+ "pl1",
+ analysisPlatform = Platform.js,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
+ private val pl2 = defaultSourceSet.copy(
+ "root",
+ "pl2",
+ "pl2",
+ analysisPlatform = Platform.jvm,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
+ private val pl3 = defaultSourceSet.copy(
+ "root",
+ "pl3",
+ "pl3",
+ analysisPlatform = Platform.native,
+ sourceRoots = listOf(SourceRootImpl("pl1"))
+ )
@Test
fun platformIndependentCase() {
diff --git a/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt b/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt
new file mode 100644
index 00000000..771cabaa
--- /dev/null
+++ b/plugins/base/src/test/kotlin/renderers/html/defaultSourceSet.kt
@@ -0,0 +1,30 @@
+package renderers.html
+
+import org.jetbrains.dokka.DokkaSourceSetImpl
+import org.jetbrains.dokka.Platform
+
+internal val defaultSourceSet = DokkaSourceSetImpl(
+ moduleName = "DEFAULT",
+ displayName = "DEFAULT",
+ sourceSetID = "DEFAULT",
+ classpath = emptyList(),
+ sourceRoots = emptyList(),
+ dependentSourceSets = emptyList(),
+ samples = emptyList(),
+ includes = emptyList(),
+ includeNonPublic = false,
+ includeRootPackage = false,
+ reportUndocumented = false,
+ skipEmptyPackages = true,
+ skipDeprecated = false,
+ jdkVersion = 8,
+ sourceLinks = emptyList(),
+ perPackageOptions = emptyList(),
+ externalDocumentationLinks = emptyList(),
+ languageVersion = null,
+ apiVersion = null,
+ noStdlibLink = false,
+ noJdkLink = false,
+ suppressedFiles = emptyList(),
+ analysisPlatform = Platform.DEFAULT
+) \ No newline at end of file