[minor] add incomplete test to the repl tests
This commit is contained in:
+11
@@ -65,6 +65,17 @@ class KotlinJsr223ScriptEngineIT {
|
|||||||
Assert.assertEquals(5, res2)
|
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
|
@Test
|
||||||
fun testEvalWithError() {
|
fun testEvalWithError() {
|
||||||
val engine = ScriptEngineManager().getEngineByExtension("kts")!!
|
val engine = ScriptEngineManager().getEngineByExtension("kts")!!
|
||||||
|
|||||||
Reference in New Issue
Block a user