aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test/kotlin
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2021-12-23 12:05:59 +0300
committerGitHub <noreply@github.com>2021-12-23 12:05:59 +0300
commit5c98d42ec08ca1413f920e4f5dde28d330e8837a (patch)
tree9661f86facd24e5bf0655cfb21bdb5a846d9e5d4 /plugins/base/src/test/kotlin
parent35f53062b10c2db3e536a9153b22a8a87e3f255d (diff)
downloaddokka-5c98d42ec08ca1413f920e4f5dde28d330e8837a.tar.gz
dokka-5c98d42ec08ca1413f920e4f5dde28d330e8837a.tar.bz2
dokka-5c98d42ec08ca1413f920e4f5dde28d330e8837a.zip
Allow filtering of property setter (#2220)
* Allow filtering of property setter * Improve code style
Diffstat (limited to 'plugins/base/src/test/kotlin')
-rw-r--r--plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt31
-rw-r--r--plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt20
2 files changed, 51 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt
index ffefaaea..1bb2d5d0 100644
--- a/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt
+++ b/plugins/base/src/test/kotlin/filter/VisibilityFilterTest.kt
@@ -105,6 +105,37 @@ class VisibilityFilterTest : BaseAbstractTest() {
}
@Test
+ fun `private setter with false global includeNonPublic`() {
+ val configuration = dokkaConfiguration {
+ sourceSets {
+ sourceSet {
+ includeNonPublic = false
+ sourceRoots = listOf("src/main/kotlin/basic/Test.kt")
+ }
+ }
+ }
+
+ testInline(
+ """
+ |/src/main/kotlin/basic/Test.kt
+ |package example
+ |
+ |var property: Int = 0
+ |private set
+ |
+ |
+ """.trimMargin(),
+ configuration
+ ) {
+ preMergeDocumentablesTransformationStage = {
+ Assertions.assertNull(
+ it.first().packages.first().properties.first().setter
+ )
+ }
+ }
+ }
+
+ @Test
fun `private function with false global true package includeNonPublic`() {
val configuration = dokkaConfiguration {
sourceSets {
diff --git a/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt b/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt
index fb8f520e..de1ee46c 100644
--- a/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/SuppressTagFilterTest.kt
@@ -89,6 +89,26 @@ class SuppressTagFilterTest : BaseAbstractTest() {
}
@Test
+ fun `should filter setter`() {
+ testInline(
+ """
+ |/src/suppressed/Suppressed.kt
+ |var property: Int
+ |/** @suppress */
+ |private set
+ """.trimIndent(), configuration
+ ) {
+ preMergeDocumentablesTransformationStage = { modules ->
+ val prop = modules.flatMap { it.packages }.flatMap { it.properties }
+ .find { it.name == "property" }
+ assertNotNull(prop)
+ assertNotNull(prop.getter)
+ assertNull(prop.setter)
+ }
+ }
+ }
+
+ @Test
fun `should filter top level type aliases`() {
testInline(
"""