[minor] add incomplete test to the repl tests

This commit is contained in:
Ilya Chernikov
2020-02-03 10:10:10 +01:00
parent 0761a17e2f
commit 49d092cae8
@@ -65,6 +65,17 @@ class KotlinJsr223ScriptEngineIT {
Assert.assertEquals(5, res2)
}
@Test
fun testIncomplete() {
val engine = ScriptEngineManager().getEngineByExtension("kts")!!
val res0 = try {
engine.eval("val x =")
} catch (e: ScriptException) {
e
}
Assert.assertTrue("Unexpected check results: $res0", (res0 as? ScriptException)?.message?.contains("Expecting an expression") ?: false)
}
@Test
fun testEvalWithError() {
val engine = ScriptEngineManager().getEngineByExtension("kts")!!