From 3882fac81a08c24c948faafe980dd181a906fa00 Mon Sep 17 00:00:00 2001 From: leaf corcoran Date: Sat, 21 Sep 2019 19:09:00 -0700 Subject: add one_of testing to avoid hash table ordering causing test to fail --- tests/test.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test.lua b/tests/test.lua index d1bf7e4..b2162b9 100755 --- a/tests/test.lua +++ b/tests/test.lua @@ -293,7 +293,12 @@ local cjson_tests = { true, { '["one",null,null,"sparse test"]' } }, { "Encode sparse array as object", json.encode, { { [1] = "one", [5] = "sparse test" } }, - true, { '{"5":"sparse test","1":"one"}' } }, + true, { + util.one_of{ + '{"5":"sparse test","1":"one"}', + '{"1":"one","5":"sparse test"}' + } + } }, { "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