backend: add two more tests for finally
This commit is contained in:
committed by
SvyatoslavScherbina
parent
4a1b3f2824
commit
2531c34b64
@@ -0,0 +1,12 @@
|
||||
fun main(args : Array<String>) {
|
||||
while (true) {
|
||||
try {
|
||||
continue
|
||||
} finally {
|
||||
println("Finally")
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
println("After")
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
fun main(args : Array<String>) {
|
||||
try {
|
||||
try {
|
||||
return
|
||||
} catch (e: Error) {
|
||||
println("Catch 1")
|
||||
} finally {
|
||||
println("Finally")
|
||||
throw Error()
|
||||
}
|
||||
} catch (e: Error) {
|
||||
println("Catch 2")
|
||||
}
|
||||
|
||||
println("Done")
|
||||
}
|
||||
Reference in New Issue
Block a user