blob: f7c6d914a35d87ab69e981ccdc05f9d806b5fcb3 [file]
// WITH_STDLIB
import kotlin.test.*
val sb = StringBuilder()
fun box(): String {
try {
sb.appendLine("Before")
throw Error("Error happens")
sb.appendLine("After")
} catch (e: Exception) {
sb.appendLine("Caught Exception")
} catch (e: Error) {
sb.appendLine("Caught Error")
} catch (e: Throwable) {
sb.appendLine("Caught Throwable")
}
sb.appendLine("Done")
assertEquals("""
Before
Caught Error
Done
""".trimIndent(), sb.toString())
return "OK"
}