aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt60
1 files changed, 58 insertions, 2 deletions
diff --git a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
index f05abb1a..5be60109 100644
--- a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
@@ -537,6 +537,63 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
}
@Test
+ fun `multiplatform undocumented function gets reported`() {
+ val configuration = dokkaConfiguration {
+ passes {
+ pass {
+ reportUndocumented = true
+ analysisPlatform = Platform.common.toString()
+ sourceSetID = "commonMain"
+ displayName = "commonMain"
+ sourceRoots = listOf("src/commonMain/kotlin")
+ }
+
+ pass {
+ reportUndocumented = true
+ analysisPlatform = Platform.jvm.toString()
+ sourceSetID = "jvmMain"
+ displayName = "jvmMain"
+ sourceRoots = listOf("src/jvmMain/kotlin")
+ dependentSourceSets = listOf("commonMain")
+ }
+
+ pass {
+ reportUndocumented = true
+ analysisPlatform = Platform.native.toString()
+ sourceSetID = "macosMain"
+ displayName = "macosMain"
+ sourceRoots = listOf("src/macosMain/kotlin")
+ dependentSourceSets = listOf("commonMain")
+ }
+ }
+ }
+
+ testInline(
+ """
+ |/src/commonMain/kotlin/sample/Common.kt
+ |package sample
+ |expect fun x()
+ |
+ |/src/macosMain/kotlin/sample/MacosMain.kt
+ |package sample
+ |/** Documented */
+ |actual fun x() = Unit
+ |
+ |/src/jvmMain/kotlin/sample/JvmMain.kt
+ |package sample
+ |actual fun x() = Unit
+ """.trimIndent(),
+ configuration
+ ) {
+ pagesTransformationStage = {
+ assertNumberOfUndocumentedReports(2)
+ assertSingleUndocumentedReport(Regex("x.*commonMain"))
+ assertSingleUndocumentedReport(Regex("x.*jvmMain"))
+ }
+ }
+ }
+
+ @Test
fun `java undocumented class gets reported`() {
val configuration = dokkaConfiguration {
passes {
@@ -830,5 +887,4 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
skipDeprecated = skipDeprecated,
suppress = suppress
)
-
-} \ No newline at end of file
+}