checkRaises
Fails the test if block doesn't raise with expected.
Example
test("√-1 raises") {
assertRaises(NegativeSquareRoot) {
sqrt(-1.0)
}
}
Content copied to clipboard
Fails the test if block doesn't raise with a value of type Failure.
Example
test("√-1 raises") {
assertRaisesWith<NegativeSquareRoot> {
sqrt(-1.0)
}
}
Content copied to clipboard