summaryrefslogtreecommitdiff
path: root/tests/lapi.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-02-15 22:13:01 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-02-15 22:19:14 +0100
commit9d6afeba223c22163928557c69a102877223d3bd (patch)
tree481efe9bfaf1095792ca1612603ef3505352d1f8 /tests/lapi.js
parent43474e4c411709e3c1ab1b1d13283d2bc4789d1d (diff)
downloadfengari-9d6afeba223c22163928557c69a102877223d3bd.tar.gz
fengari-9d6afeba223c22163928557c69a102877223d3bd.tar.bz2
fengari-9d6afeba223c22163928557c69a102877223d3bd.zip
Everything need to make luaL_newstate work, lua_pushnil test
Diffstat (limited to 'tests/lapi.js')
-rw-r--r--tests/lapi.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/lapi.js b/tests/lapi.js
index 2f493c9..b79c519 100644
--- a/tests/lapi.js
+++ b/tests/lapi.js
@@ -9,20 +9,19 @@ const getState = require("./tests.js").getState;
const VM = require("../src/lvm.js");
const ldo = require("../src/ldo.js");
const lapi = require("../src/lapi.js");
+const lauxlib = require("../src/lauxlib.js");
const CT = require('../src/lua.js').constant_types;
-test('lua_pushnil', function (t) {
+test('luaL_newstate, lua_pushnil', function (t) {
let L;
- t.plan(3);
+ t.plan(2);
t.doesNotThrow(function () {
- L = getState(`return "dummy"`);
- }, "New Lua State initiliazed");
+ L = lauxlib.luaL_newstate()
- // t.doesNotThrow(function () {
lapi.lua_pushnil(L);
- // }, "Pushed nil on the stack");
+ }, "JS Lua program ran without error");
t.strictEqual(
L.stack[L.top - 1].type,