aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--package.json2
-rw-r--r--tests/ltm.js34
-rw-r--r--tests/lvm.js58
-rw-r--r--tests/test-suite/strings.js36
4 files changed, 20 insertions, 110 deletions
diff --git a/package.json b/package.json
index 6fc5ffe..c505878 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"test": "tests"
},
"scripts": {
- "test": "./node_modules/babel-tape-runner/bin/babel-tape-runner tests/*.js | faucet"
+ "test": "./node_modules/babel-tape-runner/bin/babel-tape-runner tests/*.js tests/test-suite/*.js | faucet"
},
"repository": {
"type": "git",
diff --git a/tests/ltm.js b/tests/ltm.js
index 64f52aa..ab68e5e 100644
--- a/tests/ltm.js
+++ b/tests/ltm.js
@@ -22,8 +22,6 @@ test('__index, __newindex: with actual table', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -56,8 +54,6 @@ test('__newindex: with non table', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -91,8 +87,6 @@ test('__index function in metatable', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -135,8 +129,6 @@ test('__newindex function in metatable', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -177,8 +169,6 @@ test('__index table in metatable', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -222,8 +212,6 @@ test('__newindex table in metatable', function (t) {
t.plan(4);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -278,8 +266,6 @@ test('__index table with own metatable', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -333,8 +319,6 @@ test('__newindex table with own metatable', function (t) {
t.plan(4);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -436,8 +420,6 @@ test('binary __xxx functions in metatable', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -490,8 +472,6 @@ test('__eq', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -530,8 +510,6 @@ test('__lt', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -570,8 +548,6 @@ test('__le', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -610,8 +586,6 @@ test('__le that uses __lt', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -654,8 +628,6 @@ test('__unm, __bnot', function (t) {
t.plan(4);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -701,8 +673,6 @@ test('__len', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -742,8 +712,6 @@ test('__concat', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
@@ -783,8 +751,6 @@ test('__call', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
let bc = toByteCode(luaCode);
diff --git a/tests/lvm.js b/tests/lvm.js
index 52736fe..ff3f505 100644
--- a/tests/lvm.js
+++ b/tests/lvm.js
@@ -17,8 +17,6 @@ test('LOADK, RETURN', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -41,8 +39,6 @@ test('MOVE', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -64,8 +60,6 @@ test('Binary op', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -88,8 +82,6 @@ test('Unary op, LOADBOOL', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -111,8 +103,6 @@ test('NEWTABLE', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -138,8 +128,6 @@ test('CALL', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -170,8 +158,6 @@ test('Multiple return', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -196,8 +182,6 @@ test('TAILCALL', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -222,8 +206,6 @@ test('VARARG', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -246,8 +228,6 @@ test('LE, JMP', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -270,8 +250,6 @@ test('LT', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -294,8 +272,6 @@ test('EQ', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -319,8 +295,6 @@ test('TESTSET (and)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -344,8 +318,6 @@ test('TESTSET (or)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -373,8 +345,6 @@ test('TEST (true)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -402,8 +372,6 @@ test('TEST (false)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -430,8 +398,6 @@ test('FORPREP, FORLOOP (int)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -458,8 +424,6 @@ test('FORPREP, FORLOOP (float)', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -485,8 +449,6 @@ test('SETTABLE, GETTABLE', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -523,8 +485,6 @@ test('SETUPVAL, GETUPVAL', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -550,8 +510,6 @@ test('SETTABUP, GETTABUP', function (t) {
t.plan(3);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -585,8 +543,6 @@ test('SELF', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -609,8 +565,6 @@ test('SETLIST', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -637,8 +591,6 @@ test('Variable SETLIST', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -661,8 +613,6 @@ test('Long SETLIST', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -685,7 +635,7 @@ test('Long SETLIST', function (t) {
//
// t.plan(1);
//
-// t.comment("Running following code: \n" + luaCode);
+//
//
// // t.doesNotThrow(function () {
// L = getState(luaCode);
@@ -725,8 +675,6 @@ test('TFORCALL, TFORLOOP', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -751,8 +699,6 @@ test('LEN', function (t) {
t.plan(4);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
@@ -785,8 +731,6 @@ test('CONCAT', function (t) {
t.plan(2);
- t.comment("Running following code: \n" + luaCode);
-
t.doesNotThrow(function () {
L = getState(luaCode);
lua.lua_call(L, 0, -1);
diff --git a/tests/test-suite/strings.js b/tests/test-suite/strings.js
index 5bc2690..d6dd69f 100644
--- a/tests/test-suite/strings.js
+++ b/tests/test-suite/strings.js
@@ -17,7 +17,7 @@ const checkerror = `
end
`;
-test('testing string comparisons', function (t) {
+test('[test-suite] strings: string comparisons', function (t) {
let luaCode = `
assert('alo' < 'alo1')
assert('' < 'a')
@@ -59,7 +59,7 @@ test('testing string comparisons', function (t) {
});
-test('testing string.sub', function (t) {
+test('[test-suite] strings: string.sub', function (t) {
let luaCode = `
assert('alo' < 'alo1')
assert('' < 'a')
@@ -101,7 +101,7 @@ test('testing string.sub', function (t) {
});
-test('testing string.find', function (t) {
+test('[test-suite] strings: string.find', function (t) {
let luaCode = `
assert(string.find("123456789", "345") == 3)
a,b = string.find("123456789", "345")
@@ -139,7 +139,7 @@ test('testing string.find', function (t) {
});
-test('testing string.len and #', function (t) {
+test('[test-suite] strings: string.len and #', function (t) {
let luaCode = `
assert(string.len("") == 0)
assert(string.len("\\0\\0\\0") == 3)
@@ -171,7 +171,7 @@ test('testing string.len and #', function (t) {
});
-test('testing string.byte/string.char', function (t) {
+test('[test-suite] strings: string.byte/string.char', function (t) {
let luaCode = `
assert(string.byte("a") == 97)
assert(string.byte("\\xe4") > 127)
@@ -228,7 +228,7 @@ test('testing string.byte/string.char', function (t) {
});
-test('testing repetitions with separator', function (t) {
+test('[test-suite] strings: repetitions with separator', function (t) {
let luaCode = `
assert(string.rep('teste', 0, 'xuxu') == '')
assert(string.rep('teste', 1, 'xuxu') == 'teste')
@@ -265,7 +265,7 @@ test('testing repetitions with separator', function (t) {
});
-test('testing tostring', function (t) {
+test('[test-suite] strings: tostring', function (t) {
let luaCode = `
assert(type(tostring(nil)) == 'string')
assert(type(tostring(12)) == 'string')
@@ -317,7 +317,7 @@ test('testing tostring', function (t) {
});
-test('testing string.format', function (t) {
+test('[test-suite] strings: string.format', function (t) {
let luaCode = `
x = '"ílo"\\n\\\\'
assert(string.format('%q%s', x, x) == '"\\\\"ílo\\\\"\\\\\\n\\\\\\\\""ílo"\\n\\\\')
@@ -364,7 +364,7 @@ test('testing string.format', function (t) {
});
-test('testing %q', function (t) {
+test('[test-suite] strings: %q', function (t) {
let luaCode = `
do
local function checkQ (v)
@@ -405,7 +405,7 @@ test('testing %q', function (t) {
});
-test('testing embedded zeros error', function (t) {
+test('[test-suite] strings: embedded zeros error', function (t) {
let luaCode = `
assert(string.format("\\0%s\\0", "\\0\\0\\1") == "\\0\\0\\0\\1\\0")
checkerror("contains zeros", string.format, "%10s", "\\0")
@@ -432,7 +432,7 @@ test('testing embedded zeros error', function (t) {
});
-test('testing format x tostring', function (t) {
+test('[test-suite] strings: format x tostring', function (t) {
let luaCode = `
assert(string.format("%s %s", nil, true) == "nil true")
assert(string.format("%s %.4s", false, true) == "false true")
@@ -475,7 +475,7 @@ test('testing format x tostring', function (t) {
});
-test('testing longest number that can be formatted', function (t) {
+test('[test-suite] strings: longest number that can be formatted', function (t) {
let luaCode = `
do
local i = 1
@@ -512,7 +512,7 @@ test('testing longest number that can be formatted', function (t) {
});
-test('testing large numbers for format', function (t) {
+test('[test-suite] strings: large numbers for format', function (t) {
let luaCode = `
do -- assume at least 32 bits
local max, min = 0x7fffffff, -0x80000000 -- "large" for 32 bits
@@ -561,7 +561,7 @@ test('testing large numbers for format', function (t) {
});
-test("testing 'format %a %A'", function (t) {
+test("[test-suite] strings: 'format %a %A'", function (t) {
let luaCode = `
do
local function matchhexa (n)
@@ -618,7 +618,7 @@ test("testing 'format %a %A'", function (t) {
});
-test("testing errors in format", function (t) {
+test("[test-suite] strings: errors in format", function (t) {
let luaCode = `
local function check (fmt, msg)
checkerror(msg, string.format, fmt, 10)
@@ -658,7 +658,7 @@ test("testing errors in format", function (t) {
});
-test("testing table.concat", function (t) {
+test("[test-suite] strings: table.concat", function (t) {
let luaCode = `
checkerror("table expected", table.concat, 3)
assert(table.concat{} == "")
@@ -711,7 +711,7 @@ test("testing table.concat", function (t) {
// TODO: os.setlocale NYI
if (false) {
- test("testing locale", function (t) {
+ test("[test-suite] strings: locale", function (t) {
let luaCode = `
if not _port then
@@ -767,7 +767,7 @@ if (false) {
}
-test("testing bug in Lua 5.3.2: 'gmatch' iterator does not work across coroutines", function (t) {
+test("[test-suite] strings: bug in Lua 5.3.2: 'gmatch' iterator does not work across coroutines", function (t) {
let luaCode = `
do
local f = string.gmatch("1 2 3 4 5", "%d+")