summaryrefslogtreecommitdiff
path: root/tests/lua.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-26 08:25:57 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-26 11:37:18 +0200
commite2d9007d484641a3c3dffc325999fe509de1422a (patch)
tree846be45219388f24975ad8b4b4ea90e811e1c86f /tests/lua.js
parent55d266398191a5134b518821fb0aa9a050adbde4 (diff)
downloadfengari-e2d9007d484641a3c3dffc325999fe509de1422a.tar.gz
fengari-e2d9007d484641a3c3dffc325999fe509de1422a.tar.bz2
fengari-e2d9007d484641a3c3dffc325999fe509de1422a.zip
Breaking down lua test suite into tape tests
Diffstat (limited to 'tests/lua.js')
-rw-r--r--tests/lua.js101
1 files changed, 52 insertions, 49 deletions
diff --git a/tests/lua.js b/tests/lua.js
index 3056abd..d55b412 100644
--- a/tests/lua.js
+++ b/tests/lua.js
@@ -7,84 +7,87 @@ const lauxlib = require("../src/lauxlib.js");
const lua = require('../src/lua.js');
const linit = require('../src/linit.js');
+// TODO: remove
-test('locals.lua', function (t) {
- let luaCode = `
- _soft = true
- require = function(lib) return _G[lib] end -- NYI
- return dofile("tests/lua-tests/locals.lua")
- `, L;
-
- t.plan(2);
+if (false) {
+ test('locals.lua', function (t) {
+ let luaCode = `
+ _soft = true
+ require = function(lib) return _G[lib] end -- NYI
+ return dofile("tests/lua-tests/locals.lua")
+ `, L;
+
+ t.plan(2);
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- L = lauxlib.luaL_newstate();
+ L = lauxlib.luaL_newstate();
- linit.luaL_openlibs(L);
+ linit.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
- }, "Lua program loaded without error");
+ }, "Lua program loaded without error");
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- lapi.lua_call(L, 0, -1);
+ lapi.lua_call(L, 0, -1);
- }, "Lua program ran without error");
+ }, "Lua program ran without error");
-});
+ });
-test('constructs.lua', function (t) {
- let luaCode = `
- _soft = true
- require = function(lib) return _G[lib] end -- NYI
- return dofile("tests/lua-tests/constructs.lua")
- `, L;
-
- t.plan(2);
+ test('constructs.lua', function (t) {
+ let luaCode = `
+ _soft = true
+ require = function(lib) return _G[lib] end -- NYI
+ return dofile("tests/lua-tests/constructs.lua")
+ `, L;
+
+ t.plan(2);
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- L = lauxlib.luaL_newstate();
+ L = lauxlib.luaL_newstate();
- linit.luaL_openlibs(L);
+ linit.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
- }, "Lua program loaded without error");
+ }, "Lua program loaded without error");
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- lapi.lua_call(L, 0, -1);
+ lapi.lua_call(L, 0, -1);
- }, "Lua program ran without error");
+ }, "Lua program ran without error");
-});
+ });
-test('strings.lua', function (t) {
- let luaCode = `
- return dofile("tests/lua-tests/strings.lua")
- `, L;
-
- t.plan(2);
+ test('strings.lua', function (t) {
+ let luaCode = `
+ return dofile("tests/lua-tests/strings.lua")
+ `, L;
+
+ t.plan(2);
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- L = lauxlib.luaL_newstate();
+ L = lauxlib.luaL_newstate();
- linit.luaL_openlibs(L);
+ linit.luaL_openlibs(L);
- lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
- }, "Lua program loaded without error");
+ }, "Lua program loaded without error");
- t.doesNotThrow(function () {
+ t.doesNotThrow(function () {
- lapi.lua_call(L, 0, -1);
+ lapi.lua_call(L, 0, -1);
- }, "Lua program ran without error");
+ }, "Lua program ran without error");
-});
+ });
+}