aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/transformers
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2023-10-10 12:36:34 +0300
committerGitHub <noreply@github.com>2023-10-10 12:36:34 +0300
commit562a5951ca942c0bd26d839f2ebf509b43ca3c59 (patch)
treeba9dc75e93dc7d95c9114072946389e86f35f220 /plugins/base/src/test/kotlin/transformers
parent7503402e8b9c885ecaf27a927b66d327aea5bb14 (diff)
downloaddokka-562a5951ca942c0bd26d839f2ebf509b43ca3c59.tar.gz
dokka-562a5951ca942c0bd26d839f2ebf509b43ca3c59.tar.bz2
dokka-562a5951ca942c0bd26d839f2ebf509b43ca3c59.zip
[K2] Display enum entry members (#3180)
Diffstat (limited to 'plugins/base/src/test/kotlin/transformers')
-rw-r--r--plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt5
-rw-r--r--plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt15
2 files changed, 5 insertions, 15 deletions
diff --git a/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt b/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt
index 831d2680..c07dd5b8 100644
--- a/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/InheritedEntriesDocumentableFilterTransfromerTest.kt
@@ -9,7 +9,6 @@ import org.jetbrains.dokka.model.DEnum
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
-import utils.OnlyDescriptors
class InheritedEntriesDocumentableFilterTransformerTest : BaseAbstractTest() {
val suppressingInheritedConfiguration = dokkaConfiguration {
@@ -138,7 +137,6 @@ class InheritedEntriesDocumentableFilterTransformerTest : BaseAbstractTest() {
}
}
- @OnlyDescriptors("Entry does not have `name` and `ordinal`") // TODO
@Test
fun `should work with enum entries when not suppressing`(){
testInline(
@@ -146,7 +144,8 @@ class InheritedEntriesDocumentableFilterTransformerTest : BaseAbstractTest() {
/src/suppressed/Suppressed.kt
package suppressed
enum class Suppressed {
- ENTRY_SUPPRESSED
+ ENTRY_SUPPRESSED;
+ class A
}
""".trimIndent(),
nonSuppressingInheritedConfiguration
diff --git a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
index f7118f33..18e42e47 100644
--- a/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/MergeImplicitExpectActualDeclarationsTest.kt
@@ -13,10 +13,10 @@ import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.model.firstChildOfType
import org.jetbrains.dokka.pages.*
import utils.assertNotNull
+import utils.findSectionWithName
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNotNull
-import utils.OnlyDescriptors
class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
@@ -52,15 +52,6 @@ class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
)
}
- private fun ClasslikePageNode.findSectionWithName(name: String) : ContentNode? {
- var sectionHeader: ContentHeader? = null
- return content.dfs { node ->
- node.children.filterIsInstance<ContentHeader>().any { header ->
- header.children.firstOrNull { it is ContentText && it.text == name }?.also { sectionHeader = header } != null
- }
- }?.children?.dropWhile { child -> child != sectionHeader }?.drop(1)?.firstOrNull()
- }
-
private fun ContentNode.findTabWithType(type: TabbedContentType): ContentNode? = dfs { node ->
node.children.filterIsInstance<ContentGroup>().any { gr ->
gr.extra[TabbedContentTypeExtra]?.value == type
@@ -274,7 +265,6 @@ class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
fun PageNode.childrenRec(): List<PageNode> = listOf(this) + children.flatMap { it.childrenRec() }
- @OnlyDescriptors("Enum entry [SMTH] does not have functions") // TODO
@Test
fun `should merge enum entries`() {
testInline(
@@ -304,7 +294,8 @@ class MergeImplicitExpectActualDeclarationsTest : BaseAbstractTest() {
assertNotNull(classPage, "Tested class not found!")
val functions = classPage.findSectionWithName("Functions").assertNotNull("Functions")
- val method1 = functions.children.singleOrNull().assertNotNull("method1")
+ val method1 = functions.children.single { it.sourceSets.size == 2 && it.dci.dri.singleOrNull()?.callable?.name == "method1" }
+ .assertNotNull("method1")
assertEquals(
2,