jvmTest.org.luaj.vm2.require.RequireSampleLoadLuaError.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of luak Show documentation
Show all versions of luak Show documentation
Multiplatform Kotlin LuaJ port (LUA interpreter)
package org.luaj.vm2.require
import org.luaj.vm2.LuaValue
import org.luaj.vm2.lib.ZeroArgFunction
/**
* This should fail while trying to load via
* "require()" because it throws a LuaError
*
*/
class RequireSampleLoadLuaError : ZeroArgFunction() {
override fun call(): LuaValue {
LuaValue.error("sample-load-lua-error")
return LuaValue.valueOf("require-sample-load-lua-error")
}
}