Allow excluding Kotlin source sets from transformation

This commit is contained in:
Brian Norman
2022-03-13 16:00:10 -05:00
parent ee05aaa7e3
commit ee1370925f
6 changed files with 53 additions and 1 deletions
+6
View File
@@ -66,4 +66,10 @@ configure<com.bnorm.power.PowerAssertGradleExtension> {
"com.bnorm.power.assert",
"com.bnorm.power.dbg"
)
excludedSourceSets = listOf(
"commonMain",
"jvmMain",
"jsMain",
"nativeMain"
)
}
@@ -20,6 +20,11 @@ data class Person(
val firstName: String,
val lastName: String,
) {
init {
require(firstName.isNotBlank())
require(lastName.isNotBlank())
}
companion object {
val UNKNOWN = listOf(Person("John", "Doe"), Person("Jane", "Doe"))
override fun toString() = "Person.Companion"
@@ -63,6 +63,15 @@ class PowerAssertTest {
)
}
@Test
fun excludedRequire() {
val error = assertFailsWith<IllegalArgumentException> { Person("", "") }
assertEquals(
actual = error.message,
expected = "Failed requirement."
)
}
@Test
fun softAssert() {
val unknown: List<Person>? = Person.UNKNOWN