aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/cjson/util.lua8
1 files changed, 6 insertions, 2 deletions
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)
189 print(("[%s] %s"):format(name, serialise_value(value, false))) 189 print(("[%s] %s"):format(name, serialise_value(value, false)))
190 end 190 end
191 191
192 local result = { pcall(func, unpack(input)) } 192 local result = {}
193 local success = table.remove(result, 1) 193 local tmp = { pcall(func, unpack(input)) }
194 local success = tmp[1]
195 for i = 2, table.maxn(tmp) do
196 result[i - 1] = tmp[i]
197 end
194 198
195 local correct = false 199 local correct = false
196 if success == should_work and compare_values(result, output) then 200 if success == should_work and compare_values(result, output) then