aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 4c00453..8bb5b95 100755
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -162,15 +162,18 @@ local cjson_tests = {
162 true, { {{{{{ "nested" }}}}} } }, 162 true, { {{{{{ "nested" }}}}} } },
163 { "Decode array over nested limit [throw error]", 163 { "Decode array over nested limit [throw error]",
164 json.decode, { '[[[[[[ "nested" ]]]]]]' }, 164 json.decode, { '[[[[[[ "nested" ]]]]]]' },
165 false, { "Too many nested data structures" } }, 165 false, { "Found too many nested data structures (6) at character 6" } },
166 { "Decode object at nested limit", 166 { "Decode object at nested limit",
167 json.decode, { '{"a":{"b":{"c":{"d":{"e":"nested"}}}}}' }, 167 json.decode, { '{"a":{"b":{"c":{"d":{"e":"nested"}}}}}' },
168 true, { {a={b={c={d={e="nested"}}}}} } }, 168 true, { {a={b={c={d={e="nested"}}}}} } },
169 { "Decode object over nested limit [throw error]", 169 { "Decode object over nested limit [throw error]",
170 json.decode, { '{"a":{"b":{"c":{"d":{"e":{"f":"nested"}}}}}}' }, 170 json.decode, { '{"a":{"b":{"c":{"d":{"e":{"f":"nested"}}}}}}' },
171 false, { "Too many nested data structures" } }, 171 false, { "Found too many nested data structures (6) at character 26" } },
172 { "Set decode_max_depth(1000)", 172 { "Set decode_max_depth(1000)",
173 json.decode_max_depth, { 1000 }, true, { 1000 } }, 173 json.decode_max_depth, { 1000 }, true, { 1000 } },
174 { "Decode deeply nested array [throw error]",
175 json.decode, { string.rep("[", 1100) .. '1100' .. string.rep("]", 1100)},
176 false, { "Found too many nested data structures (1001) at character 1001" } },
174 177
175 -- Test encoding nested tables 178 -- Test encoding nested tables
176 { "Set encode_max_depth(5)", 179 { "Set encode_max_depth(5)",