aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorYichun Zhang (agentzh) <agentzh@gmail.com>2017-11-15 20:23:23 -0800
committerYichun Zhang (agentzh) <agentzh@gmail.com>2017-11-15 20:23:23 -0800
commitefd56ddb9f4571afbd3232672efd7ff4da3beae5 (patch)
tree0232108ffd7dd3d6d547b4d7fe374b3cabe1cf54 /lua
parentbf7e15d1b341d04c4e06bc6fc1c4e2c37f29b1ab (diff)
downloadlua-cjson-efd56ddb9f4571afbd3232672efd7ff4da3beae5.tar.gz
lua-cjson-efd56ddb9f4571afbd3232672efd7ff4da3beae5.tar.bz2
lua-cjson-efd56ddb9f4571afbd3232672efd7ff4da3beae5.zip
tests: now we use luajit to run the test suite.
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