aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-18 12:13:43 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-18 12:13:43 +0200
commit35e1ec3457c653521e8afa7cd05984309f0ba67a (patch)
tree925bf04c1806eba02dc175f567b12acfd8b45a1b
parentc31a8135a7b094732f2129b247c982fc58ee52f6 (diff)
downloadfengari-35e1ec3457c653521e8afa7cd05984309f0ba67a.tar.gz
fengari-35e1ec3457c653521e8afa7cd05984309f0ba67a.tar.bz2
fengari-35e1ec3457c653521e8afa7cd05984309f0ba67a.zip
tests locals.lua
-rw-r--r--tests/lua.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/lua.js b/tests/lua.js
index 30a9c98..28fa9fd 100644
--- a/tests/lua.js
+++ b/tests/lua.js
@@ -8,6 +8,34 @@ const lua = require('../src/lua.js');
const linit = require('../src/linit.js');
+test('locals.lua', function (t) {
+ let luaCode = `
+ _soft = true
+ require = function(lib) return _G[lib] end -- NYI
+ return dofile("tests/lua-tests/locals.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('constructs.lua', function (t) {
let luaCode = `
_soft = true