From 46a6fc85d2486e02156b4c48c8a14e1009fbdc30 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 7 Feb 2017 07:53:25 +0100 Subject: adjust_varargs, use constant for nil values --- tests/lvm.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/lvm.js') 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 -- cgit v1.2.3-54-g00ecf