aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt47
-rw-r--r--plugins/base/src/test/kotlin/utils/contentUtils.kt7
2 files changed, 28 insertions, 26 deletions
diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
index 9f8ebb00..6b86d727 100644
--- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
+++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
@@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test
import utils.pWrapped
import utils.signature
import utils.signatureWithReceiver
+import utils.unnamedTag
class ContentForParamsTest : AbstractCoreTest() {
private val testConfiguration = dokkaConfiguration {
@@ -94,10 +95,8 @@ class ContentForParamsTest : AbstractCoreTest() {
signature("function", null, "abc" to "String")
header(3) { +"Description" }
platformHinted {
- header(4) { +"Author" }
- +"Kordyjan"
- header(4) { +"Since" }
- +"0.11"
+ unnamedTag("Author") { +"Kordyjan" }
+ unnamedTag("Since") { +"0.11" }
}
}
}
@@ -129,10 +128,8 @@ class ContentForParamsTest : AbstractCoreTest() {
header(3) { +"Description" }
platformHinted {
pWrapped("comment to function")
- header(4) { +"Author" }
- +"Kordyjan"
- header(4) { +"Since" }
- +"0.11"
+ unnamedTag("Author") { +"Kordyjan" }
+ unnamedTag("Since") { +"0.11" }
}
}
}
@@ -167,7 +164,7 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"abc"
- +"comment to param"
+ group { +"comment to param" }
}
}
}
@@ -206,15 +203,15 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"first"
- +"comment to first param"
+ group { +"comment to first param" }
}
group {
+"second"
- +"comment to second param"
+ group { +"comment to second param" }
}
group {
+"third"
- +"comment to third param"
+ group { +"comment to third param" }
}
}
}
@@ -251,15 +248,15 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"first"
- +"comment to first param"
+ group { +"comment to first param" }
}
group {
+"second"
- +"comment to second param"
+ group { +"comment to second param" }
}
group {
+"third"
- +"comment to third param"
+ group { +"comment to third param" }
}
}
}
@@ -297,11 +294,11 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"<receiver>"
- +"comment to receiver"
+ group { +"comment to receiver" }
}
group {
+"abc"
- +"comment to param"
+ group { +"comment to param" }
}
}
}
@@ -339,11 +336,11 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"first"
- +"comment to first param"
+ group { +"comment to first param" }
}
group {
+"third"
- +"comment to third param"
+ group { +"comment to third param" }
}
}
}
@@ -384,21 +381,19 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"first"
- +"comment to first param"
+ group { +"comment to first param" }
}
group {
+"second"
- +"comment to second param"
+ group { +"comment to second param" }
}
group {
+"third"
- +"comment to third param"
+ group { +"comment to third param" }
}
}
- header(4) { +"Author" }
- +"Kordyjan"
- header(4) { +"Since" }
- +"0.11"
+ unnamedTag("Author") { +"Kordyjan" }
+ unnamedTag("Since") { +"0.11" }
}
}
}
diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt
index 4bb36553..1e19058a 100644
--- a/plugins/base/src/test/kotlin/utils/contentUtils.kt
+++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt
@@ -1,6 +1,7 @@
package utils
import matchers.content.*
+import org.jetbrains.dokka.pages.ContentGroup
//TODO: Try to unify those functions after update to 1.4
fun ContentMatcherBuilder<*>.signature(
@@ -53,4 +54,10 @@ fun ContentMatcherBuilder<*>.pWrapped(text: String) =
group {// TODO: remove it when double wrapping for descriptions will be resolved
group { +text }
br()
+ }
+
+fun ContentMatcherBuilder<*>.unnamedTag(tag: String, content: ContentMatcherBuilder<ContentGroup>.() -> Unit) =
+ group {
+ header(4) { +tag }
+ group { content() }
} \ No newline at end of file