aboutsummaryrefslogtreecommitdiff
path: root/tests/lapi.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 13:47:33 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 13:47:33 +0100
commitea562b1094672f641707c0f809827a0d3a982f23 (patch)
tree2cc9fe28a7553a58037b9541a25b2f5d2437c0f2 /tests/lapi.js
parentcdf8cf1806ca793c47095b69382b2dd733899af7 (diff)
downloadfengari-ea562b1094672f641707c0f809827a0d3a982f23.tar.gz
fengari-ea562b1094672f641707c0f809827a0d3a982f23.tar.bz2
fengari-ea562b1094672f641707c0f809827a0d3a982f23.zip
lua_newtable, lua_createtable
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