diff options
Diffstat (limited to 'tests/lapi.js')
-rw-r--r-- | tests/lapi.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/lapi.js b/tests/lapi.js index 39477b2..251c5a8 100644 --- a/tests/lapi.js +++ b/tests/lapi.js @@ -36,4 +36,31 @@ test('luaL_newstate, lua_pushnil, lua_gettop, luaL_typename', function (t) { "nil", "Correct element(s) on the stack" ); +}); + + +test('lua_pushnumber', function (t) { + let L; + + t.plan(3); + + t.doesNotThrow(function () { + + L = lauxlib.luaL_newstate(); + + lapi.lua_pushnumber(L, 10); + + }, "JS Lua program ran without error"); + + t.strictEqual( + lapi.lua_gettop(L), + 1, + "top is correct" + ); + + t.strictEqual( + lauxlib.luaL_typename(L, lapi.lua_gettop(L)), + "number", + "Correct element(s) on the stack" + ); });
\ No newline at end of file |