function assertFailsWith
source · line 8public
public fun <E : Throwable> assertFailsWith(message: String? = None, location: SourceLocation = currentSourceLocation(), block: () -> Unit): E
Runs the block and returns the thrown exception if it has the requested type. Normal return or another exception type produces AssertionFailure; a mismatched exception is retained as its cause.
parameter block
source · line 11public
block: () -> Unit
type parameter E
source · line 8public
E : Throwable
parameter location
source · line 10public
location: SourceLocation = currentSourceLocation()
parameter message
source · line 9public
message: String? = None