aboutsummaryrefslogtreecommitdiff
path: root/tests/lapi.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lapi.js')
-rw-r--r--tests/lapi.js38
1 files changed, 38 insertions, 0 deletions
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