JakobOvrum/LuaD

LuaState.loadFile checks incorrect return value

goughy opened this issue · 1 comments

According to http://www.lua.org/manual/5.1/manual.html#luaL_loadfile, the return code from the function is the same as http://www.lua.org/manual/5.1/manual.html#lua_load, which indicates that the return value of "0" means success (no errors).

However, https://github.com/JakobOvrum/LuaD/blob/master/luad/state.d#L227 checks for the value "1" as success.

That's what I get for not writing unittests thoroughly enough :)

I've been meaning to cover as much as possible in the unittests by checking what's missing with DMD's profiler, that would've caught this one.