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. --- tests/TestLua.pm | 4 ++-- tests/agentzh.t | 3 +++ tests/test.lua | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/TestLua.pm b/tests/TestLua.pm index b029a72..64372ad 100644 --- a/tests/TestLua.pm +++ b/tests/TestLua.pm @@ -35,9 +35,9 @@ sub run_test ($) { if ($ENV{TEST_LUA_USE_VALGRIND}) { warn "$name\n"; - @cmd = ('valgrind', '-q', '--leak-check=full', 'lua', 'test_case.lua'); + @cmd = ('valgrind', '-q', '--leak-check=full', 'luajit', 'test_case.lua'); } else { - @cmd = ('lua', 'test_case.lua'); + @cmd = ('luajit', 'test_case.lua'); } run3 \@cmd, undef, \$res, \$err; diff --git a/tests/agentzh.t b/tests/agentzh.t index 3b0ecf1..0b281a1 100644 --- a/tests/agentzh.t +++ b/tests/agentzh.t @@ -1,3 +1,6 @@ +# vim:ft= + +use lib '.'; use TestLua; plan tests => 2 * blocks(); diff --git a/tests/test.lua b/tests/test.lua index c96dd3d..3da8676 100755 --- a/tests/test.lua +++ b/tests/test.lua @@ -293,7 +293,7 @@ local cjson_tests = { true, { '["one",null,null,"sparse test"]' } }, { "Encode sparse array as object", json.encode, { { [1] = "one", [5] = "sparse test" } }, - true, { '{"1":"one","5":"sparse test"}' } }, + true, { '{"5":"sparse test","1":"one"}' } }, { "Encode table with numeric string key as object", json.encode, { { ["2"] = "numeric string key test" } }, true, { '{"2":"numeric string key test"}' } }, -- cgit v1.2.3-55-g6feb