notToThrow
inline fun Expect.Companion.notToThrow(crossinline block: () -> Unit)(source)
Asserts that the given block does not throw any exception.
If the block throws an exception, the assertion fails with a message indicating that an exception was thrown, and the exception is included as the cause.
Context Parameters
The assertion scope that will consume the assertion result.
Parameters
The code block that should not throw an exception. Called exactly once.
inline fun <Result> Expect.Companion.notToThrow(crossinline block: () -> Result, checker: Expect<Result>.() -> Unit)(source)
Asserts that the given block does not throw any exception, and if it succeeds, asserts on the result using the provided checker.
If the block throws an exception, the assertion fails immediately with a message indicating that an exception was thrown. If the block succeeds, the result is passed to the checker for further assertions.
Context Parameters
The assertion scope that will consume the assertion result.
Parameters
The code block that should not throw an exception. Called exactly once.
The assertion block to execute on the result if no exception is thrown.
Type Parameters
The type of the result produced by the block.