summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-11 11:19:55 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-11 11:19:55 +0200
commit992c58899b32c919d3c5c1c60c14c7c073c5d54c (patch)
treefdf156cf211355f383c2d6c44041531decca95f7 /tests
parent4d4782d890830d7730f0f9ada5638f9443e76047 (diff)
parent57ca9b375d262d98645d219bbdd5969e0c0c85aa (diff)
downloadfengari-992c58899b32c919d3c5c1c60c14c7c073c5d54c.tar.gz
fengari-992c58899b32c919d3c5c1c60c14c7c073c5d54c.tar.bz2
fengari-992c58899b32c919d3c5c1c60c14c7c073c5d54c.zip
Merge branch 'feature/dead-keys'
Diffstat (limited to 'tests')
-rw-r--r--tests/ltablib.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/ltablib.js b/tests/ltablib.js
index e209db3..43e742b 100644
--- a/tests/ltablib.js
+++ b/tests/ltablib.js
@@ -14,7 +14,7 @@ const inttable2array = function(t) {
let a = [];
t.strong.forEach(function (v, k) {
- if (typeof k === 'number')
+ if (v.key.ttisnumber())
a[k - 1] = v.value;
});
@@ -73,7 +73,7 @@ test('table.pack', function (t) {
t.deepEqual(
[...lua.lua_topointer(L, -1).strong.entries()]
- .filter(e => typeof e[0] === 'number') // Filter out the 'n' field
+ .filter(e => e[1].key.ttisnumber()) // Filter out the 'n' field
.map(e => e[1].value.value).reverse(),
[1, 2, 3],
"Correct element(s) on the stack"
@@ -148,7 +148,7 @@ test('table.insert', function (t) {
t.deepEqual(
[...lua.lua_topointer(L, -1).strong.entries()]
- .filter(e => typeof e[0] === 'number')
+ .filter(e => e[1].key.ttisnumber())
.map(e => e[1].value.value).sort(),
[1, 2, 3, 4, 5],
"Correct element(s) on the stack"
@@ -182,7 +182,7 @@ test('table.remove', function (t) {
t.deepEqual(
[...lua.lua_topointer(L, -1).strong.entries()]
- .filter(e => typeof e[0] === 'number')
+ .filter(e => e[1].key.ttisnumber())
.map(e => e[1].value.value).sort(),
[1, 2, 3, 4],
"Correct element(s) on the stack"
@@ -215,7 +215,7 @@ test('table.move', function (t) {
t.deepEqual(
[...lua.lua_topointer(L, -1).strong.entries()]
- .filter(e => typeof e[0] === 'number')
+ .filter(e => e[1].key.ttisnumber())
.map(e => e[1].value.value).sort(),
[1, 2, 3, 4, 5, 6],
"Correct element(s) on the stack"