commonMain.korlibs.test.truth.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktruth-jvm Show documentation
Show all versions of ktruth-jvm Show documentation
Multiplatform testing library. Based off the truth API: https://truth.dev/
The newest version!
package korlibs.test
import kotlin.test.*
fun assertThat(actual: Double) = DoubleSubject(actual)
fun assertThat(actual: Boolean) = BooleanSubject(actual)
fun assertThat(actual: T) = AnySubject(actual)
fun assertThat(actual: Collection) = CollectionSubject(actual)
inline fun assertThat(actual: Map) = MapSubject(actual)
fun testAssertFailsWithMessage(expectedErrorMessage: String, block: () -> Unit) {
try {
block()
} catch (assertionError: AssertionError) {
assertEquals(expectedErrorMessage, assertionError.message)
}
}