aboutsummaryrefslogtreecommitdiff
path: root/tests/test-suite
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-11 14:02:23 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-11 15:19:18 +1000
commite7cf17565e26dc5c4a100688526b0dfed1220e44 (patch)
treeee4606b23f9c62ecf0e6da20dcbf0472d5339fd9 /tests/test-suite
parentbe3f9810115cbaded69be37ebc3d088ee252a225 (diff)
downloadfengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.tar.gz
fengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.tar.bz2
fengari-e7cf17565e26dc5c4a100688526b0dfed1220e44.zip
Move luaL_openlibs from lauxlib to lualib
Diffstat (limited to 'tests/test-suite')
-rw-r--r--tests/test-suite/calls.js37
-rw-r--r--tests/test-suite/constructs.js17
-rw-r--r--tests/test-suite/events.js11
-rw-r--r--tests/test-suite/locals.js15
-rw-r--r--tests/test-suite/strings.js42
-rw-r--r--tests/test-suite/vararg.js13
6 files changed, 71 insertions, 64 deletions
diff --git a/tests/test-suite/calls.js b/tests/test-suite/calls.js
index 63d7f35..451f6c0 100644
--- a/tests/test-suite/calls.js
+++ b/tests/test-suite/calls.js
@@ -4,8 +4,9 @@ const test = require('tape');
global.WEB = false;
-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("[test-suite] calls: test 'type'", function (t) {
@@ -30,7 +31,7 @@ test("[test-suite] calls: test 'type'", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -68,7 +69,7 @@ test("[test-suite] calls: test error in 'print'", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -104,7 +105,7 @@ test("[test-suite] calls: testing local-function recursion", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -211,7 +212,7 @@ test("[test-suite] calls: testing declarations", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -269,7 +270,7 @@ test("[test-suite] calls: testing closures", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -327,7 +328,7 @@ test("[test-suite] calls: testing multiple returns", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -356,7 +357,7 @@ test("[test-suite] calls: testing calls with 'incorrect' arguments", function (t
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -428,7 +429,7 @@ test("[test-suite] calls: test for generic load", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -454,7 +455,7 @@ test("[test-suite] calls: any value is valid for _ENV", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -491,7 +492,7 @@ test("[test-suite] calls: load when _ENV is not first upvalue", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -536,7 +537,7 @@ test("[test-suite] calls: test generic load with nested functions", function (t)
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -576,7 +577,7 @@ test("[test-suite] calls: test for dump/undump with upvalues", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -623,7 +624,7 @@ test("[test-suite] calls: test for dump/undump with many upvalues", function (t)
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -655,7 +656,7 @@ test("[test-suite] calls: test for long method names", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -683,7 +684,7 @@ test("[test-suite] calls: test for bug in parameter adjustment", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -742,7 +743,7 @@ test("[test-suite] calls: testing binary chunks", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
diff --git a/tests/test-suite/constructs.js b/tests/test-suite/constructs.js
index b6a44cf..d260843 100644
--- a/tests/test-suite/constructs.js
+++ b/tests/test-suite/constructs.js
@@ -4,8 +4,9 @@ const test = require('tape');
global.WEB = false;
-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');
const checkload = `
@@ -27,7 +28,7 @@ test('[test-suite] constructs: testing semicolons', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
@@ -53,7 +54,7 @@ test('[test-suite] constructs: invalid operations should not raise errors when n
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
@@ -118,7 +119,7 @@ test('[test-suite] constructs: testing priorities', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
@@ -304,7 +305,7 @@ test('[test-suite] constructs: silly loops', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
@@ -393,7 +394,7 @@ if (false) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
@@ -430,7 +431,7 @@ test("[test-suite] constructs: testing some syntax errors (chosen through 'gcov'
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkload + luaCode));
diff --git a/tests/test-suite/events.js b/tests/test-suite/events.js
index 3c9a590..d7dfe15 100644
--- a/tests/test-suite/events.js
+++ b/tests/test-suite/events.js
@@ -4,8 +4,9 @@ const test = require('tape');
global.WEB = false;
-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("[test-suite] events: testing metatable", function (t) {
@@ -188,7 +189,7 @@ test("[test-suite] events: testing metatable", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -222,7 +223,7 @@ test("[test-suite] events: test for rawlen", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -283,7 +284,7 @@ test("[test-suite] events: test comparison", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
diff --git a/tests/test-suite/locals.js b/tests/test-suite/locals.js
index 78eb24d..3815f5d 100644
--- a/tests/test-suite/locals.js
+++ b/tests/test-suite/locals.js
@@ -4,8 +4,9 @@ const test = require('tape');
global.WEB = false;
-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('[test-suite] locals: bug in 5.1', function (t) {
@@ -26,7 +27,7 @@ test('[test-suite] locals: bug in 5.1', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -98,7 +99,7 @@ test('[test-suite] locals: local scope', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -138,7 +139,7 @@ test('[test-suite] locals: test for global table of loaded chunks', function (t)
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(getenv + luaCode));
@@ -181,7 +182,7 @@ test('[test-suite] locals: old test for limits for special instructions (now jus
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -235,7 +236,7 @@ test('[test-suite] locals: testing lexical environments', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(getenv + luaCode));
diff --git a/tests/test-suite/strings.js b/tests/test-suite/strings.js
index 033b324..a0d057c 100644
--- a/tests/test-suite/strings.js
+++ b/tests/test-suite/strings.js
@@ -4,8 +4,10 @@ const test = require('tape');
global.WEB = false;
-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');
+
const checkerror = `
local maxi, mini = math.maxinteger, math.mininteger
@@ -43,7 +45,7 @@ test('[test-suite] strings: string comparisons', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -85,7 +87,7 @@ test('[test-suite] strings: string.sub', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -123,7 +125,7 @@ test('[test-suite] strings: string.find', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -155,7 +157,7 @@ test('[test-suite] strings: string.len and #', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -212,7 +214,7 @@ test('[test-suite] strings: string.byte/string.char', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -249,7 +251,7 @@ test('[test-suite] strings: repetitions with separator', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -301,7 +303,7 @@ test('[test-suite] strings: tostring', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -348,7 +350,7 @@ test('[test-suite] strings: string.format', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -389,7 +391,7 @@ test('[test-suite] strings: %q', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -416,7 +418,7 @@ test('[test-suite] strings: embedded zeros error', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -459,7 +461,7 @@ test('[test-suite] strings: format x tostring', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -496,7 +498,7 @@ test('[test-suite] strings: longest number that can be formatted', function (t)
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -545,7 +547,7 @@ test('[test-suite] strings: large numbers for format', function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -602,7 +604,7 @@ test("[test-suite] strings: 'format %a %A'", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -642,7 +644,7 @@ test("[test-suite] strings: errors in format", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -693,7 +695,7 @@ test("[test-suite] strings: table.concat", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -750,7 +752,7 @@ if (false) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
@@ -782,7 +784,7 @@ test("[test-suite] strings: bug in Lua 5.3.2: 'gmatch' iterator does not work ac
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(checkerror + luaCode));
diff --git a/tests/test-suite/vararg.js b/tests/test-suite/vararg.js
index 0dab1b6..3b147bc 100644
--- a/tests/test-suite/vararg.js
+++ b/tests/test-suite/vararg.js
@@ -4,8 +4,9 @@ const test = require('tape');
global.WEB = false;
-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("[test-suite] vararg: testing vararg", function (t) {
@@ -82,7 +83,7 @@ test("[test-suite] vararg: testing vararg", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -127,7 +128,7 @@ test("[test-suite] vararg: new-style varargs", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -177,7 +178,7 @@ test("[test-suite] vararg: varargs for main chunks", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
@@ -213,7 +214,7 @@ test("[test-suite] vararg: bug in 5.2.2", function (t) {
L = lauxlib.luaL_newstate();
- lauxlib.luaL_openlibs(L);
+ lualib.luaL_openlibs(L);
lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));