Ihar Hancharenka 5dff80e88e first
2023-03-27 16:52:17 +03:00

10 строки
395 B
Plaintext

an [IndexOutOfBoundsException] should be thrownBy s.charAt(-1)
val thrown = the [IndexOutOfBoundsException] should be thrownBy s.charAt(-1)
thrown.getMessage should equal ("String index out of range: -1")
the [ArithmeticException] thrown by 1 / 0 should have message "/by zero"
the [IndexOutOfBoundsException] thrownBy {
s.charAt(-1)
} should have message "String index out of range: -1"