You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple class defined in a file called simple.kts
class Test {
val x = 5
}
Testing the Script Engine Manager using the following: @test
fun testClassCompile() {
val scriptReader = this::class.java.classLoader.getResource("simple.kts").openStream().reader()
val engine = ScriptEngineManager().getEngineByExtension("kts")
try {
val result = engine.eval(scriptReader)
assertNotNull(result)
}catch (se: ScriptException) {
fail()
}
}
If I am not mistaken this test should be returning an Object of type Class and not null. Please correct me if I am incorrect or have misunderstood how to get the Class object back.
The text was updated successfully, but these errors were encountered:
Kotlin version 1.8.20
Simple class defined in a file called simple.kts
class Test {
val x = 5
}
Testing the Script Engine Manager using the following:
@test
fun testClassCompile() {
val scriptReader = this::class.java.classLoader.getResource("simple.kts").openStream().reader()
val engine = ScriptEngineManager().getEngineByExtension("kts")
try {
val result = engine.eval(scriptReader)
assertNotNull(result)
}catch (se: ScriptException) {
fail()
}
}
If I am not mistaken this test should be returning an Object of type Class and not null. Please correct me if I am incorrect or have misunderstood how to get the Class object back.
The text was updated successfully, but these errors were encountered: