aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src')
-rw-r--r--plugins/base/src/test/kotlin/signatures/SignatureTest.kt69
1 files changed, 13 insertions, 56 deletions
diff --git a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt
index 1f875a0d..f7439d67 100644
--- a/plugins/base/src/test/kotlin/signatures/SignatureTest.kt
+++ b/plugins/base/src/test/kotlin/signatures/SignatureTest.kt
@@ -11,7 +11,7 @@ class SignatureTest : AbstractCoreTest() {
private val configuration = dokkaConfiguration {
sourceSets {
sourceSet {
- sourceRoots = listOf("src/main/kotlin/test/Test.kt")
+ sourceRoots = listOf("src/")
classpath = listOf(commonStdlibPath!!)
externalDocumentationLinks = listOf(stdlibExternalDocumentationLink)
}
@@ -178,15 +178,6 @@ class SignatureTest : AbstractCoreTest() {
@Test
fun `class with no supertype`() {
-
- val configuration = dokkaConfiguration {
- sourceSets {
- sourceSet {
- sourceRoots = listOf("src/main/kotlin/test/Test.kt")
- }
- }
- }
-
val source = source("class SimpleClass")
val writerPlugin = TestOutputWriterPlugin()
@@ -205,15 +196,6 @@ class SignatureTest : AbstractCoreTest() {
@Test
fun `class with generic supertype`() {
-
- val configuration = dokkaConfiguration {
- sourceSets {
- sourceSet {
- sourceRoots = listOf("src/main/kotlin/test/Test.kt")
- }
- }
- }
-
val source = source("class InheritingClassFromGenericType<T : Number, R : CharSequence> : Comparable<T>, Collection<R>")
val writerPlugin = TestOutputWriterPlugin()
@@ -352,12 +334,16 @@ class SignatureTest : AbstractCoreTest() {
moduleName = "test"
name = "common"
sourceRoots = listOf("src/main/kotlin/common/Test.kt")
+ classpath = listOf(commonStdlibPath!!)
+ externalDocumentationLinks = listOf(stdlibExternalDocumentationLink)
}
sourceSet {
moduleName = "test"
name = "jvm"
dependentSourceSets = setOf(DokkaSourceSetID("test", "common"))
sourceRoots = listOf("src/main/kotlin/jvm/Test.kt")
+ classpath = listOf(commonStdlibPath!!)
+ externalDocumentationLinks = listOf(stdlibExternalDocumentationLink)
}
}
}
@@ -392,16 +378,6 @@ class SignatureTest : AbstractCoreTest() {
@Test
fun `plain typealias of plain class`() {
- val configuration = dokkaConfiguration {
- sourceSets {
- sourceSet {
- moduleName = "test"
- name = "common"
- sourceRoots = listOf("src/main/kotlin/common/Test.kt")
- }
- }
- }
-
val writerPlugin = TestOutputWriterPlugin()
testInline(
@@ -416,8 +392,8 @@ class SignatureTest : AbstractCoreTest() {
pluginOverrides = listOf(writerPlugin)
) {
renderingStage = { _, _ ->
- writerPlugin.writer.renderedContent("test/example.html").signature().first().match(
- "typealias ", A("PlainTypealias"), " = ", A("Int"), Span()
+ writerPlugin.writer.renderedContent("root/example.html").signature().first().match(
+ "typealias ", Span("PlainTypealias"), " = ", A("Int"), Span()
)
}
}
@@ -426,16 +402,6 @@ class SignatureTest : AbstractCoreTest() {
@Test
fun `plain typealias of generic class`() {
- val configuration = dokkaConfiguration {
- sourceSets {
- sourceSet {
- moduleName = "test"
- name = "common"
- sourceRoots = listOf("src/main/kotlin/common/Test.kt")
- }
- }
- }
-
val writerPlugin = TestOutputWriterPlugin()
testInline(
@@ -450,8 +416,8 @@ class SignatureTest : AbstractCoreTest() {
pluginOverrides = listOf(writerPlugin)
) {
renderingStage = { _, _ ->
- writerPlugin.writer.renderedContent("test/example.html").signature().first().match(
- "typealias ", A("PlainTypealias"), " = ", A("Comparable"),
+ writerPlugin.writer.renderedContent("root/example.html").signature().first().match(
+ "typealias ", Span("PlainTypealias"), " = ", A("Comparable"),
"<", A("Int"), ">", Span()
)
}
@@ -461,15 +427,6 @@ class SignatureTest : AbstractCoreTest() {
@Test
fun `typealias with generics params`() {
- val configuration = dokkaConfiguration {
- sourceSets {
- sourceSet {
- moduleName = "test"
- name = "common"
- sourceRoots = listOf("src/main/kotlin/common/Test.kt")
- }
- }
- }
val writerPlugin = TestOutputWriterPlugin()
@@ -485,9 +442,9 @@ class SignatureTest : AbstractCoreTest() {
pluginOverrides = listOf(writerPlugin)
) {
renderingStage = { _, _ ->
- writerPlugin.writer.renderedContent("test/example.html").signature().first().match(
- "typealias ", A("GenericTypealias"), "<", A("T"), "> = ", A("Comparable"),
- "<", A("T"), ">", Span()
+ writerPlugin.writer.renderedContent("root/example.html").signature().first().match(
+ "typealias ", Span("GenericTypealias"), "<", Span("T"), "> = ", A("Comparable"),
+ "<", Span("T"), ">", Span()
)
}
}
@@ -499,4 +456,4 @@ class SignatureTest : AbstractCoreTest() {
private fun Element.signature() = select("div.symbol.monospace")
private fun Element.firstSignature() = signature().first()
-} \ No newline at end of file
+}