Files
kotlin-fork/backend.native/tests/runtime/exceptions/catch1.kt
T
2017-10-20 18:25:05 +03:00

20 lines
325 B
Kotlin

package runtime.exceptions.catch1
import kotlin.test.*
@Test fun runTest() {
try {
println("Before")
foo()
println("After")
} catch (e: Throwable) {
println("Caught Throwable")
}
println("Done")
}
fun foo() {
throw Error("Error happens")
println("After in foo()")
}