aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin/translators
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test/kotlin/translators')
-rw-r--r--plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt28
1 files changed, 26 insertions, 2 deletions
diff --git a/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt b/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt
index 9a96ad29..3a440af0 100644
--- a/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt
+++ b/plugins/base/src/test/kotlin/translators/DefaultDescriptorToDocumentableTranslatorTest.kt
@@ -1,13 +1,13 @@
package translators
import org.jetbrains.dokka.DokkaConfiguration
+import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.modifiers
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.PointingToDeclaration
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.doc.*
-import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Assertions.assertNull
+import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import utils.text
@@ -1049,6 +1049,30 @@ val soapXml = node("soap-env:Envelope", soapAttrs,
}
}
}
+
+ @Test
+ fun `should add data modifier to data objects`() {
+ testInline(
+ """
+ |/src/main/kotlin/test/KotlinDataObject.kt
+ |package test
+ |
+ |data object KotlinDataObject {}
+ """.trimIndent(),
+ configuration
+ ) {
+ documentablesMergingStage = { module ->
+ val pckg = module.packages.single { it.name == "test" }
+
+ val dataObject = pckg.classlikes.single { it.name == "KotlinDataObject" }
+ assertInstanceOf(DObject::class.java, dataObject)
+
+ val modifiers = (dataObject as DObject).modifiers().values.flatten()
+ assertEquals(1, modifiers.size)
+ assertEquals(ExtraModifiers.KotlinOnlyModifiers.Data, modifiers[0])
+ }
+ }
+ }
}
private sealed class TestSuite {