Sebastian Schuberth
11/29/2021, 1:17 PMshouldNotThrowAny
?sam
11/29/2021, 1:32 PMSebastian Schuberth
11/29/2021, 1:50 PMinline fun <T> shouldNotThrowAny(block: () -> T): T {
assertionCounter.inc()
val thrownException = try {
return block()
} catch (e: Throwable) {
e
}
throw failure(
"No exception expected, but a ${thrownException::class.simpleName} was thrown.",
thrownException
)
}