Skip to content

Commit

Permalink
fix gradle include combinator (#3278)
Browse files Browse the repository at this point in the history
* fix gradle include combinator

* fix incorrect expectation
  • Loading branch information
myuwono committed Nov 1, 2022
1 parent d74dce5 commit 3f568e4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Expand Up @@ -18,7 +18,7 @@ class ContainerTimeoutTest : FunSpec() {
.launch()
collector.tests.keys.map { it.name.testName }.toSet() shouldBe setOf("a")
collector.tests.values.map { it.errorOrNull?.message }.toSet() shouldBe setOf(
"Test 'a' did not complete within 10ms",
"Test 'a' did not complete within 100ms",
)
}
}
Expand Down
Expand Up @@ -14,7 +14,7 @@ class GradleClassMethodRegexTestFilter(private val patterns: List<String>) : Tes
logger.log { Pair(descriptor.toString(), "Testing against $patterns") }
return when {
patterns.isEmpty() -> TestFilterResult.Include
patterns.all { match(it, descriptor) } -> TestFilterResult.Include
patterns.any { match(it, descriptor) } -> TestFilterResult.Include
else -> TestFilterResult.Exclude(null)
}
}
Expand Down
Expand Up @@ -43,22 +43,22 @@ class GradleClassMethodRegexTestFilterTest : FunSpec({
val test = container.append("nested test")

withData(
nameFn = { filters -> "should be INCLUDED when evaluating $filters" },
nameFn = { filters -> "should be INCLUDED if any of the filters matches when evaluating $filters" },
listOf("\\Qio.kotest.runner.junit.platform.gradle\\E"),
listOf("\\Qio.kotest.runner.junit.platform.gradle.\\E.*"),
listOf(".*\\Qnner.junit.platform.gradle\\E"),
listOf(".*\\Qnner.junit.platform.gradle.\\E.*"),
listOf(".*\\Q.junit.platform.gradle\\E"),
listOf("\\Qio.kotest.runner.junit.platform.gra\\E.*"),
listOf("\\Qio.kotest.runner.junit\\E"),
listOf(".*\\QNotSpec\\E", "\\Qio.kotest.runner.junit\\E"),
) { filters ->
GradleClassMethodRegexTestFilter(filters).filter(spec) shouldBe TestFilterResult.Include
}

withData(
nameFn = { filters -> "should be EXCLUDED when evaluating $filters" },
nameFn = { filters -> "should be EXCLUDED if none of the filters matches when evaluating $filters" },
listOf("\\Qio.kotest.runner.junit2\\E"),
listOf("\\Qio.kotest.runner.junit\\E", ".*\\QSpec\\E"),
listOf("\\Qio.kotest.runner.junit2\\E", ".*\\QNotSpec\\E"),
) { filters ->
GradleClassMethodRegexTestFilter(filters).filter(spec) shouldBe TestFilterResult.Exclude(null)
}
Expand Down

0 comments on commit 3f568e4

Please sign in to comment.