diff options
Diffstat (limited to 'tests/lexparse.js')
-rw-r--r-- | tests/lexparse.js | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/tests/lexparse.js b/tests/lexparse.js index 0f13ccd..ecb386f 100644 --- a/tests/lexparse.js +++ b/tests/lexparse.js @@ -5,12 +5,13 @@ const test = require('tape'); const tests = require("./tests.js"); const toByteCode = tests.toByteCode; -const lua = require("../src/lua.js"); -const lapi = require("../src/lapi.js"); -const lauxlib = require("../src/lauxlib.js"); +const lua = require('../src/lua.js'); +const lauxlib = require('../src/lauxlib.js'); +const lualib = require('../src/lualib.js'); +const lapi = require('../src/lapi.js'); -// Roughly the same tests as test/lvm.js to cover all opcodes +// Roughly the same tests as test/lvm.js to cover all opcodes test('LOADK, RETURN', function (t) { let luaCode = ` local a = "hello world" @@ -23,7 +24,7 @@ test('LOADK, RETURN', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -63,7 +64,7 @@ test('MOVE', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -103,7 +104,7 @@ test('Binary op', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -143,7 +144,7 @@ test('Unary op, LOADBOOL', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -181,7 +182,7 @@ test('NEWTABLE', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -223,7 +224,7 @@ test('CALL', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -269,7 +270,7 @@ test('Multiple return', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -310,7 +311,7 @@ test('TAILCALL', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -351,7 +352,7 @@ test('VARARG', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -390,7 +391,7 @@ test('LE, JMP', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -429,7 +430,7 @@ test('LT', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -468,7 +469,7 @@ test('EQ', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -508,7 +509,7 @@ test('TESTSET (and)', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -548,7 +549,7 @@ test('TESTSET (or)', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -592,7 +593,7 @@ test('TEST (false)', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -635,7 +636,7 @@ test('FORPREP, FORLOOP (int)', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -678,7 +679,7 @@ test('FORPREP, FORLOOP (float)', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -720,7 +721,7 @@ test('SETTABLE, GETTABLE', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -771,7 +772,7 @@ test('SETUPVAL, GETUPVAL', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -813,7 +814,7 @@ test('SETTABUP, GETTABUP', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -863,7 +864,7 @@ test('SELF', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -902,7 +903,7 @@ test('SETLIST', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -945,7 +946,7 @@ test('Variable SETLIST', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -983,7 +984,7 @@ test('Long SETLIST', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -1038,7 +1039,7 @@ test('TFORCALL, TFORLOOP', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -1079,7 +1080,7 @@ test('LEN', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; @@ -1128,7 +1129,7 @@ test('CONCAT', function (t) { L = lauxlib.luaL_newstate(); - lauxlib.luaL_openlibs(L); + lualib.luaL_openlibs(L); let reader = function(L, data) { let code = luaCode ? luaCode.trim() : null; |