diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lbaselib.js | 1 | ||||
-rw-r--r-- | tests/lexparse.js | 4 | ||||
-rw-r--r-- | tests/ltablib.js | 2 | ||||
-rw-r--r-- | tests/lvm.js | 4 |
4 files changed, 5 insertions, 6 deletions
diff --git a/tests/lbaselib.js b/tests/lbaselib.js index dd91449..5f39991 100644 --- a/tests/lbaselib.js +++ b/tests/lbaselib.js @@ -15,7 +15,6 @@ const lua = require('../src/lua.js'); const linit = require('../src/linit.js'); const CT = lua.constant_types; - test('print', function (t) { let luaCode = ` print("hello", "world", 123) diff --git a/tests/lexparse.js b/tests/lexparse.js index 92901b1..96c8fca 100644 --- a/tests/lexparse.js +++ b/tests/lexparse.js @@ -742,7 +742,7 @@ test('SETTABLE, GETTABLE', function (t) { }, "Lua program ran without error"); t.strictEqual( - lapi.lua_topointer(L, -1).get(0).jsstring(), + lapi.lua_topointer(L, -1).get(1).jsstring(), "hello", "Program output is correct" ); @@ -835,7 +835,7 @@ test('SETTABUP, GETTABUP', function (t) { }, "Lua program ran without error"); t.strictEqual( - lapi.lua_topointer(L, -1).get(0).jsstring(), + lapi.lua_topointer(L, -1).get(1).jsstring(), "hello", "Program output is correct" ); diff --git a/tests/ltablib.js b/tests/ltablib.js index 81ffcbd..60f9abc 100644 --- a/tests/ltablib.js +++ b/tests/ltablib.js @@ -21,7 +21,7 @@ const inttable2array = function(t) { t.forEach(function (v, k) { if (typeof k === 'number') - a[k] = v; + a[k - 1] = v; }); return a.map(e => e.value); diff --git a/tests/lvm.js b/tests/lvm.js index bda4c4f..0f91d81 100644 --- a/tests/lvm.js +++ b/tests/lvm.js @@ -496,7 +496,7 @@ test('SETTABLE, GETTABLE', function (t) { console.log(L.stack[L.top - 1]); t.deepEqual( - L.stack[L.top - 1].value.get(0).jsstring(), + L.stack[L.top - 1].value.get(1).jsstring(), "hello", "Program output is correct" ); @@ -559,7 +559,7 @@ test('SETTABUP, GETTABUP', function (t) { }, "Program executed without errors"); t.deepEqual( - L.stack[L.top - 1].value.get(0).jsstring(), + L.stack[L.top - 1].value.get(1).jsstring(), "hello", // "hello" "Program output is correct" ); |