summaryrefslogtreecommitdiff
path: root/tests/lbaselib.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lbaselib.js')
-rw-r--r--tests/lbaselib.js40
1 files changed, 21 insertions, 19 deletions
diff --git a/tests/lbaselib.js b/tests/lbaselib.js
index ca83467..bfaac9c 100644
--- a/tests/lbaselib.js
+++ b/tests/lbaselib.js
@@ -5,8 +5,10 @@ const test = require('tape');
const tests = require("./tests.js");
const toByteCode = tests.toByteCode;
-const lauxlib = require("../src/lauxlib.js");
-const lua = require('../src/lua.js');
+const lua = require('../src/lua.js');
+const lauxlib = require('../src/lauxlib.js');
+const lualib = require('../src/lualib.js');
+
test('print', function (t) {
let luaCode = `
@@ -21,7 +23,7 @@ test('print', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-print"), lua.to_luastring("binary"));
@@ -55,7 +57,7 @@ test('setmetatable, getmetatable', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-setmetatable-getmetatable"), lua.to_luastring("binary"));
@@ -100,7 +102,7 @@ test('rawequal', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-rawequal"), lua.to_luastring("binary"));
@@ -146,7 +148,7 @@ test('rawset, rawget', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-rawequal"), lua.to_luastring("binary"));
@@ -193,7 +195,7 @@ test('type', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-type"), lua.to_luastring("binary"));
@@ -246,7 +248,7 @@ test('error', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-error"), lua.to_luastring("binary"));
@@ -269,7 +271,7 @@ test('error, protected', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-error"), lua.to_luastring("binary"));
@@ -301,7 +303,7 @@ test('pcall', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-pcall"), lua.to_luastring("binary"));
@@ -337,7 +339,7 @@ test('xpcall', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-pcall"), lua.to_luastring("binary"));
@@ -379,7 +381,7 @@ test('ipairs', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-ipairs"), lua.to_luastring("binary"));
@@ -408,7 +410,7 @@ test('select', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-select"), lua.to_luastring("binary"));
@@ -453,7 +455,7 @@ test('tonumber', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-tonumber"), lua.to_luastring("binary"));
@@ -505,7 +507,7 @@ test('assert', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-assert"), lua.to_luastring("binary"));
@@ -533,7 +535,7 @@ test('rawlen', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-rawlen"), lua.to_luastring("binary"));
@@ -580,7 +582,7 @@ test('next', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-next"), lua.to_luastring("binary"));
@@ -621,7 +623,7 @@ test('pairs', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-pairs"), lua.to_luastring("binary"));
@@ -671,7 +673,7 @@ test('pairs with __pairs', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lua.lua_load(L, null, bc, lua.to_luastring("test-pairs"), lua.to_luastring("binary"));