aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorleaf corcoran <leafot@gmail.com>2019-09-21 19:09:00 -0700
committerleaf <leafot@gmail.com>2020-04-25 14:24:18 -0700
commit3882fac81a08c24c948faafe980dd181a906fa00 (patch)
tree7804d668dd532cf3e167402f001123910928d57d /tests
parent0d0c4063d00bc33549832a8d58a00c9836c04df8 (diff)
downloadlua-cjson-3882fac81a08c24c948faafe980dd181a906fa00.tar.gz
lua-cjson-3882fac81a08c24c948faafe980dd181a906fa00.tar.bz2
lua-cjson-3882fac81a08c24c948faafe980dd181a906fa00.zip
add one_of testing to avoid hash table ordering causing test to fail
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test.lua7
1 files changed, 6 insertions, 1 deletions
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 = {
293 true, { '["one",null,null,"sparse test"]' } }, 293 true, { '["one",null,null,"sparse test"]' } },
294 { "Encode sparse array as object", 294 { "Encode sparse array as object",
295 json.encode, { { [1] = "one", [5] = "sparse test" } }, 295 json.encode, { { [1] = "one", [5] = "sparse test" } },
296 true, { '{"5":"sparse test","1":"one"}' } }, 296 true, {
297 util.one_of{
298 '{"5":"sparse test","1":"one"}',
299 '{"1":"one","5":"sparse test"}'
300 }
301 } },
297 { "Encode table with numeric string key as object", 302 { "Encode table with numeric string key as object",
298 json.encode, { { ["2"] = "numeric string key test" } }, 303 json.encode, { { ["2"] = "numeric string key test" } },
299 true, { '{"2":"numeric string key test"}' } }, 304 true, { '{"2":"numeric string key test"}' } },