diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-04-14 14:54:21 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-04-14 14:54:21 +0200 |
commit | 8e05003853773ef4d38913858ee4fc636bed21ac (patch) | |
tree | 973252273f28e3407fa09036ab2e4ce75c3aeb99 /tests/lua.js | |
parent | 8db55335c1134925a39bbcafb5ca2a2517d9b135 (diff) | |
download | fengari-8e05003853773ef4d38913858ee4fc636bed21ac.tar.gz fengari-8e05003853773ef4d38913858ee4fc636bed21ac.tar.bz2 fengari-8e05003853773ef4d38913858ee4fc636bed21ac.zip |
constructs.lua tests
Diffstat (limited to 'tests/lua.js')
-rw-r--r-- | tests/lua.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lua.js b/tests/lua.js index 43e82bc..7a0fb9b 100644 --- a/tests/lua.js +++ b/tests/lua.js @@ -7,6 +7,33 @@ const lauxlib = require("../src/lauxlib.js"); const lua = require('../src/lua.js'); const linit = require('../src/linit.js'); + +test('constructs.lua', function (t) { + let luaCode = ` + return dofile("tests/lua-tests/constructs.lua") + `, L; + + t.plan(1); + + t.doesNotThrow(function () { + + L = lauxlib.luaL_newstate(); + + linit.luaL_openlibs(L); + + lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode)); + + }, "Lua program loaded without error"); + + // t.doesNotThrow(function () { + + lapi.lua_call(L, 0, -1); + + // }, "Lua program ran without error"); + +}); + + test('strings.lua', function (t) { let luaCode = ` return dofile("tests/lua-tests/strings.lua") |