From efd56ddb9f4571afbd3232672efd7ff4da3beae5 Mon Sep 17 00:00:00 2001 From: "Yichun Zhang (agentzh)" Date: Wed, 15 Nov 2017 20:23:23 -0800 Subject: tests: now we use luajit to run the test suite. --- lua/cjson/util.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/cjson/util.lua b/lua/cjson/util.lua index 6916dad..5d80106 100644 --- a/lua/cjson/util.lua +++ b/lua/cjson/util.lua @@ -189,8 +189,12 @@ local function run_test(testname, func, input, should_work, output) print(("[%s] %s"):format(name, serialise_value(value, false))) end - local result = { pcall(func, unpack(input)) } - local success = table.remove(result, 1) + local result = {} + local tmp = { pcall(func, unpack(input)) } + local success = tmp[1] + for i = 2, table.maxn(tmp) do + result[i - 1] = tmp[i] + end local correct = false if success == should_work and compare_values(result, output) then -- cgit v1.2.3-55-g6feb