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.kt152
-rw-r--r--plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt168
-rw-r--r--plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt12
-rw-r--r--plugins/base/src/test/kotlin/enums/EnumsTest.kt10
-rw-r--r--plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt2
-rw-r--r--plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt8
-rw-r--r--plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt14
7 files changed, 183 insertions, 183 deletions
diff --git a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
index 1116dfa9..2dce7e28 100644
--- a/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
+++ b/plugins/base/src/test/kotlin/content/params/ContentForParamsTest.kt
@@ -84,9 +84,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
- group { pWrapped("comment to function") }
- }
divergent {
bareSignature(
emptyMap(),
@@ -98,6 +95,9 @@ class ContentForParamsTest : AbstractCoreTest() {
"abc" to ParamAttributes(emptyMap(), emptySet(), "String")
)
}
+ after {
+ group { pWrapped("comment to function") }
+ }
}
}
}
@@ -129,10 +129,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
- unnamedTag("Author") { group { +"Kordyjan" } }
- unnamedTag("Since") { group { +"0.11" } }
- }
divergent {
bareSignature(
emptyMap(),
@@ -144,6 +140,10 @@ class ContentForParamsTest : AbstractCoreTest() {
"abc" to ParamAttributes(emptyMap(), emptySet(), "String")
)
}
+ after {
+ unnamedTag("Author") { group { +"Kordyjan" } }
+ unnamedTag("Since") { group { +"0.11" } }
+ }
}
}
}
@@ -176,11 +176,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
- group { pWrapped("comment to function") }
- unnamedTag("Author") { group { +"Kordyjan" } }
- unnamedTag("Since") { group { +"0.11" } }
- }
divergent {
bareSignature(
emptyMap(),
@@ -192,6 +187,11 @@ class ContentForParamsTest : AbstractCoreTest() {
"abc" to ParamAttributes(emptyMap(), emptySet(), "String")
)
}
+ after {
+ group { pWrapped("comment to function") }
+ unnamedTag("Author") { group { +"Kordyjan" } }
+ unnamedTag("Since") { group { +"0.11" } }
+ }
}
}
}
@@ -223,7 +223,18 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
group { pWrapped("comment to function") }
header(2) { +"Parameters" }
group {
@@ -237,17 +248,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -281,7 +281,15 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(), "", "", emptySet(), "function", null,
+ "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
+ "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
+ "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
+ )
+ }
+ after {
group { group { group { +"comment to function" } } }
header(2) { +"Parameters" }
group {
@@ -289,28 +297,20 @@ class ContentForParamsTest : AbstractCoreTest() {
table {
group {
+"first"
- group { group { +"comment to first param" } }
+ group { group { +"comment to first param" } }
}
group {
+"second"
- group { group { +"comment to second param" } }
+ group { group { +"comment to second param" } }
}
group {
+"third"
- group { group { +"comment to third param" } }
+ group { group { +"comment to third param" } }
}
}
}
}
}
- divergent {
- bareSignature(
- emptyMap(), "", "", emptySet(), "function", null,
- "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
- "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
- "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
- )
- }
}
}
}
@@ -343,7 +343,15 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(), "", "", emptySet(), "function", null,
+ "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
+ "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
+ "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
+ )
+ }
+ after {
header(2) { +"Parameters" }
group {
platformHinted {
@@ -364,14 +372,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(), "", "", emptySet(), "function", null,
- "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
- "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
- "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
- )
- }
}
}
}
@@ -404,7 +404,19 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignatureWithReceiver(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "String",
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
group { pWrapped("comment to function") }
header(2) { +"Parameters" }
group {
@@ -422,18 +434,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignatureWithReceiver(
- emptyMap(),
- "",
- "",
- emptySet(),
- "String",
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -466,7 +466,15 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(), "", "", emptySet(), "function", null,
+ "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
+ "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
+ "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
+ )
+ }
+ after {
group { group { group { +"comment to function" } } }
header(2) { +"Parameters" }
group {
@@ -484,14 +492,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(), "", "", emptySet(), "function", null,
- "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
- "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
- "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
- )
- }
}
}
}
@@ -527,7 +527,15 @@ class ContentForParamsTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(), "", "", emptySet(), "function", null,
+ "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
+ "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
+ "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
+ )
+ }
+ after {
group { pWrapped("comment to function") }
unnamedTag("Author") { group { +"Kordyjan" } }
unnamedTag("Since") { group { +"0.11" } }
@@ -552,14 +560,6 @@ class ContentForParamsTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(), "", "", emptySet(), "function", null,
- "first" to ParamAttributes(emptyMap(), emptySet(), "String"),
- "second" to ParamAttributes(emptyMap(), emptySet(), "Int"),
- "third" to ParamAttributes(emptyMap(), emptySet(), "Double")
- )
- }
}
}
}
diff --git a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt
index aa9ac045..d5d1966d 100644
--- a/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt
+++ b/plugins/base/src/test/kotlin/content/seealso/ContentForSeeAlsoTest.kt
@@ -81,7 +81,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -95,17 +106,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -136,7 +136,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -152,17 +163,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -193,7 +193,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -207,17 +218,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -248,7 +248,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -264,17 +275,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -308,7 +308,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
group { group { group { +"random comment"} } }
unnamedTag("Author") { group { +"pikinier20" } }
unnamedTag("Since") { group { +"0.11" } }
@@ -328,17 +339,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -370,7 +370,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -386,17 +397,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
@@ -428,7 +428,18 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
divergentGroup {
divergentInstance {
- before {
+ divergent {
+ bareSignature(
+ emptyMap(),
+ "",
+ "",
+ emptySet(),
+ "function",
+ null,
+ "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
+ )
+ }
+ after {
header(2) { +"See also" }
group {
platformHinted {
@@ -449,17 +460,6 @@ class ContentForSeeAlsoTest : AbstractCoreTest() {
}
}
}
- divergent {
- bareSignature(
- emptyMap(),
- "",
- "",
- emptySet(),
- "function",
- null,
- "abc" to ParamAttributes(emptyMap(), emptySet(), "String")
- )
- }
}
}
}
diff --git a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
index b3da3f71..df1bfbc6 100644
--- a/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
+++ b/plugins/base/src/test/kotlin/content/signatures/SkippingParenthesisForConstructorsTest.kt
@@ -212,7 +212,6 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
group {
header(1) { +"SomeClass" }
platformHinted {
- skipAllNotMatching()
group {
+"class"
link { +"SomeClass" }
@@ -220,6 +219,7 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
group { link { +"String" } }
+")"
}
+ skipAllNotMatching()
}
}
group {
@@ -229,11 +229,6 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
link { +"SomeClass" }
platformHinted {
group {
- group {
- group { +"ctor comment" }
- }
- }
- group {
+"fun"
link { +"SomeClass" }
+"(a:"
@@ -242,6 +237,11 @@ class ConstructorsSignaturesTest : AbstractCoreTest() {
}
+")"
}
+ group {
+ group {
+ group { +"ctor comment" }
+ }
+ }
}
}
}
diff --git a/plugins/base/src/test/kotlin/enums/EnumsTest.kt b/plugins/base/src/test/kotlin/enums/EnumsTest.kt
index 3d1495fe..134a1cc6 100644
--- a/plugins/base/src/test/kotlin/enums/EnumsTest.kt
+++ b/plugins/base/src/test/kotlin/enums/EnumsTest.kt
@@ -211,15 +211,15 @@ class EnumsTest : AbstractCoreTest() {
platformHinted {
group {
group {
- group {
- +"Sample docs for E1"
- }
+ link { +"E1" }
+ +"()"
}
}
group {
group {
- link { +"E1" }
- +"()"
+ group {
+ +"Sample docs for E1"
+ }
}
}
}
diff --git a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
index f67d73bb..38c7569a 100644
--- a/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
+++ b/plugins/base/src/test/kotlin/linkableContent/LinkableContentTest.kt
@@ -209,7 +209,7 @@ class LinkableContentTest : AbstractCoreTest() {
val function = classChildren.find { it.name == "printWithExclamation" }
val text = function.cast<MemberPageNode>().content.cast<ContentGroup>().children.last()
.cast<ContentDivergentGroup>().children.single()
- .cast<ContentDivergentInstance>().before
+ .cast<ContentDivergentInstance>().after
.cast<ContentGroup>().children.last()
.cast<ContentGroup>().children.last()
.cast<PlatformHintedContent>().children.single()
diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
index ad0d421e..8c78eff7 100644
--- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
+++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt
@@ -209,7 +209,7 @@ class DivergentTest : HtmlRenderingOnlyTestBase() {
renderedContent.match(
Div(
Div(
- Div("ab-"),
+ "ab-",
Span()
),
Div(Div(Div("ab")))
@@ -281,7 +281,7 @@ class DivergentTest : HtmlRenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
Div(
- Div(Div("ab-"), Span()),
+ Div("ab-", Span()),
Div(Div(Div("ab"))),
"ab+"
)
@@ -319,8 +319,8 @@ class DivergentTest : HtmlRenderingOnlyTestBase() {
HtmlRenderer(context).render(page)
renderedContent.match(
- Div(Div(Div("a-"), Span()), Div(Div(Div("a"))), "ab+"),
- Div(Div(Div("b-"), Span()), Div(Div(Div(("b")))), "ab+")
+ Div(Div("a-", Span()), Div(Div(Div("a"))), "ab+"),
+ Div(Div("b-", Span()), Div(Div(Div(("b")))), "ab+")
)
}
}
diff --git a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt
index d72b5c33..4662db4e 100644
--- a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt
+++ b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt
@@ -58,7 +58,7 @@ class DivergentSignatureTest : AbstractCoreTest() {
val content = writerPlugin.renderedContent("example/example/-clock/get-time.html")
assert(content.count() == 1)
- assert(content.select("[data-filterable-current=example/common example/js example/jvm]").single().brief == "common")
+ assert(content.select("[data-filterable-current=example/common example/js example/jvm]").single().brief == "")
}
}
}
@@ -75,8 +75,8 @@ class DivergentSignatureTest : AbstractCoreTest() {
renderingStage = { _, _ ->
val content = writerPlugin.renderedContent("example/example/-clock/get-times-in-millis.html")
assert(content.count() == 2)
- assert(content.select("[data-filterable-current=example/common example/jvm]").single().brief == "Time in minis common")
- assert(content.select("[data-filterable-current=example/js]").single().brief == "JS implementation of getTimeInMillis js" )
+ assert(content.select("[data-filterable-current=example/common example/jvm]").single().brief == "Time in minis")
+ assert(content.select("[data-filterable-current=example/js]").single().brief == "JS implementation of getTimeInMillis" )
}
}
}
@@ -93,9 +93,9 @@ class DivergentSignatureTest : AbstractCoreTest() {
renderingStage = { _, _ ->
val content = writerPlugin.renderedContent("example/example/-clock/get-year.html")
assert(content.count() == 3)
- assert(content.select("[data-filterable-current=example/jvm]").single().brief == "JVM custom kdoc jvm")
- assert(content.select("[data-filterable-current=example/js]").single().brief == "JS custom kdoc js")
- assert(content.select("[data-filterable-current=example/common]").single().brief == "common")
+ assert(content.select("[data-filterable-current=example/jvm]").single().brief == "JVM custom kdoc")
+ assert(content.select("[data-filterable-current=example/js]").single().brief == "JS custom kdoc")
+ assert(content.select("[data-filterable-current=example/common]").single().brief == "")
}
}
}
@@ -104,5 +104,5 @@ class DivergentSignatureTest : AbstractCoreTest() {
.let { Jsoup.parse(it) }.select("#content").single().select("div.divergent-group")
private val Element.brief: String
- get() = children().select(".brief-with-platform-tags").text()
+ get() = children().select("p").text()
}