summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-07 07:53:25 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-07 07:53:25 +0100
commit46a6fc85d2486e02156b4c48c8a14e1009fbdc30 (patch)
treeb2c5b573f98b3480cfbab2aaff600dcea4a0464d /tests
parented24912b2bfe3666a51760ca4b8e1a29ada12e25 (diff)
downloadfengari-46a6fc85d2486e02156b4c48c8a14e1009fbdc30.tar.gz
fengari-46a6fc85d2486e02156b4c48c8a14e1009fbdc30.tar.bz2
fengari-46a6fc85d2486e02156b4c48c8a14e1009fbdc30.zip
adjust_varargs, use constant for nil values
Diffstat (limited to 'tests')
-rw-r--r--tests/lvm.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/lvm.js b/tests/lvm.js
index 62f9fff..e10ddb2 100644
--- a/tests/lvm.js
+++ b/tests/lvm.js
@@ -249,11 +249,11 @@ test('TAILCALL', function (t) {
test('VARARG', function (t) {
let luaCode = `
- local f = function (a, b)
- return a + b
+ local f = function (...)
+ return ...
end
- return f(1,2)
+ return f(1,2,3)
`, vm;
t.plan(2);
@@ -265,9 +265,9 @@ test('VARARG', function (t) {
vm.execute();
}, "Program executed without errors");
- t.strictEqual(
- vm.L.stack[vm.L.top - 1].value,
- 3,
+ t.deepEqual(
+ vm.L.stack.slice(vm.L.stack.length - 3).map(function (e) { return e.value; }),
+ [1, 2, 3],
"Program output is correct"
);
}); \ No newline at end of file