
jvmMain.io.kotest.assertions.arrow.refinements.matchers.kt Maven / Gradle / Ivy
package io.kotest.assertions.arrow.refinements
import arrow.validation.Refinement
import io.kotest.assertions.arrow.matcher
import io.kotest.matchers.Matcher
import io.kotest.matchers.should
/**
* Asserts that a value of type [A] complies with the [refinement]
*/
infix fun A.shouldBeRefinedBy(refinement: Refinement): Unit =
this should beRefinedBy(refinement)
/**
* Creates a [Matcher] for [A] given the [refinement] rules
*/
fun A.beRefinedBy(refinement: Refinement): Matcher =
refinement.run {
matcher(
passed = [email protected](),
msg = invalidValueMsg(this@beRefinedBy)
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy