diff --git a/library/src/commonTest/kotlin/ScriptTest.kt b/library/src/commonTest/kotlin/ScriptTest.kt index 53098d0..7dad62e 100644 --- a/library/src/commonTest/kotlin/ScriptTest.kt +++ b/library/src/commonTest/kotlin/ScriptTest.kt @@ -1833,4 +1833,25 @@ class ScriptTest { """.trimIndent()) } + @Test + fun testTryFinally() = runTest { + val c = Context() + assertFails { + c.eval( + """ + var resource = "used" + try { + throw "test" + } + finally { + resource = "freed" + } + """.trimIndent() + ) + } + c.eval(""" + assertEquals("freed", resource) + """.trimIndent()) + } + } \ No newline at end of file