aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/test
diff options
context:
space:
mode:
authorMartin Bonnin <martin@mbonnin.net>2020-11-18 12:48:03 +0100
committerGitHub <noreply@github.com>2020-11-18 12:48:03 +0100
commit1959b914c0838be814d45f617517ac73fa33cd47 (patch)
tree899805a421b45625ceffd599520a3f3e3d237e5a /plugins/base/src/test
parentd6c798e44381fd436a264229f94f19528382c136 (diff)
downloaddokka-1959b914c0838be814d45f617517ac73fa33cd47.tar.gz
dokka-1959b914c0838be814d45f617517ac73fa33cd47.tar.bz2
dokka-1959b914c0838be814d45f617517ac73fa33cd47.zip
Add matchingRegex (#598)
* add matchingRegex as a simpler replacement for `prefix` * remove useless check * added a note about the order of the matchingRegex
Diffstat (limited to 'plugins/base/src/test')
-rw-r--r--plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt6
-rw-r--r--plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt14
-rw-r--r--plugins/base/src/test/kotlin/transformers/SuppressedDocumentableFilterTransformerTest.kt16
3 files changed, 19 insertions, 17 deletions
diff --git a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt
index c8b9f2d4..b90b02af 100644
--- a/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt
+++ b/plugins/base/src/test/kotlin/filter/DeprecationFilterTest.kt
@@ -104,11 +104,13 @@ class DeprecationFilterTest : AbstractCoreTest() {
sourceRoots = listOf("src/main/kotlin/basic/Test.kt")
skipDeprecated = false
perPackageOptions = mutableListOf(
- PackageOptionsImpl("example",
+ PackageOptionsImpl(
+ "example.*",
true,
false,
true,
- false)
+ false
+ )
)
}
}
diff --git a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
index 265baa42..a87a8e7f 100644
--- a/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/ReportUndocumentedTransformerTest.kt
@@ -380,7 +380,7 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
sourceSets {
sourceSet {
perPackageOptions += packageOptions(
- prefix = "sample",
+ matchingRegex = "sample.*",
reportUndocumented = true,
)
reportUndocumented = false
@@ -410,11 +410,11 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
sourceSets {
sourceSet {
perPackageOptions += packageOptions(
- prefix = "sample",
+ matchingRegex = "sample.*",
reportUndocumented = false,
)
perPackageOptions += packageOptions(
- prefix = "sample.enabled",
+ matchingRegex = "sample.enabled.*",
reportUndocumented = true,
)
reportUndocumented = false
@@ -448,11 +448,11 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
sourceSets {
sourceSet {
perPackageOptions += packageOptions(
- prefix = "sample",
+ matchingRegex = "sample.*",
reportUndocumented = true,
)
perPackageOptions += packageOptions(
- prefix = "sample.disabled",
+ matchingRegex = "sample.disabled.*",
reportUndocumented = false,
)
reportUndocumented = true
@@ -904,13 +904,13 @@ class ReportUndocumentedTransformerTest : AbstractCoreTest() {
}
private fun packageOptions(
- prefix: String,
+ matchingRegex: String,
reportUndocumented: Boolean?,
includeNonPublic: Boolean = true,
skipDeprecated: Boolean = false,
suppress: Boolean = false
) = PackageOptionsImpl(
- prefix = prefix,
+ matchingRegex = matchingRegex,
reportUndocumented = reportUndocumented,
includeNonPublic = includeNonPublic,
skipDeprecated = skipDeprecated,
diff --git a/plugins/base/src/test/kotlin/transformers/SuppressedDocumentableFilterTransformerTest.kt b/plugins/base/src/test/kotlin/transformers/SuppressedDocumentableFilterTransformerTest.kt
index 93b36d2e..a4ce9230 100644
--- a/plugins/base/src/test/kotlin/transformers/SuppressedDocumentableFilterTransformerTest.kt
+++ b/plugins/base/src/test/kotlin/transformers/SuppressedDocumentableFilterTransformerTest.kt
@@ -16,8 +16,8 @@ class SuppressedDocumentableFilterTransformerTest : AbstractCoreTest() {
sourceSet {
sourceRoots = listOf("src")
perPackageOptions = listOf(
- packageOptions(prefix = "suppressed", suppress = true),
- packageOptions(prefix = "default", suppress = false)
+ packageOptions(matchingRegex = "suppressed.*", suppress = true),
+ packageOptions(matchingRegex = "default.*", suppress = false)
)
}
}
@@ -57,11 +57,11 @@ class SuppressedDocumentableFilterTransformerTest : AbstractCoreTest() {
sourceSet {
sourceRoots = listOf("src")
perPackageOptions = listOf(
- packageOptions(prefix = "parent.some", suppress = false),
- packageOptions(prefix = "parent.some.suppressed", suppress = true),
+ packageOptions(matchingRegex = "parent.some.*", suppress = false),
+ packageOptions(matchingRegex = "parent.some.suppressed.*", suppress = true),
- packageOptions(prefix = "parent.other", suppress = true),
- packageOptions(prefix = "parent.other.default", suppress = false)
+ packageOptions(matchingRegex = "parent.other.*", suppress = true),
+ packageOptions(matchingRegex = "parent.other.default.*", suppress = false)
)
}
}
@@ -175,10 +175,10 @@ class SuppressedDocumentableFilterTransformerTest : AbstractCoreTest() {
}
private fun packageOptions(
- prefix: String,
+ matchingRegex: String,
suppress: Boolean
) = PackageOptionsImpl(
- prefix = prefix,
+ matchingRegex = matchingRegex,
suppress = suppress,
includeNonPublic = true,
reportUndocumented = false,