From ea562b1094672f641707c0f809827a0d3a982f23 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 17 Feb 2017 13:47:33 +0100 Subject: lua_newtable, lua_createtable --- tests/lapi.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'tests') diff --git a/tests/lapi.js b/tests/lapi.js index 419e5c4..561841f 100644 --- a/tests/lapi.js +++ b/tests/lapi.js @@ -438,4 +438,42 @@ test('lua script reads js upvalues', function (t) { "hello world", "Correct element(s) on the stack" ); +}); + + +test('lua_createtable', function (t) { + let L; + + t.plan(2); + + t.doesNotThrow(function () { + L = lauxlib.luaL_newstate(); + + lapi.lua_createtable(L, 3, 3); + + }, "JS Lua program ran without error"); + + t.ok( + lapi.lua_istable(L, -1), + "Correct element(s) on the stack" + ); +}); + + +test('lua_newtable', function (t) { + let L; + + t.plan(2); + + t.doesNotThrow(function () { + L = lauxlib.luaL_newstate(); + + lapi.lua_newtable(L); + + }, "JS Lua program ran without error"); + + t.ok( + lapi.lua_istable(L, -1), + "Correct element(s) on the stack" + ); }); \ No newline at end of file -- cgit v1.2.3-70-g09d2