aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.lua')
-rwxr-xr-xtests/test.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 436b20c..10d8989 100755
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -63,6 +63,9 @@ if not utf8_loaded then
63end 63end
64local utf16_escaped = gen_utf16_escaped() 64local utf16_escaped = gen_utf16_escaped()
65local nested5 = {{{{{ "nested" }}}}} 65local nested5 = {{{{{ "nested" }}}}}
66local table_cycle = {}
67local table_cycle2 = { table_cycle }
68table_cycle[1] = table_cycle2
66 69
67local decode_simple_tests = { 70local decode_simple_tests = {
68 { json.decode, { '"test string"' }, true, { "test string" } }, 71 { json.decode, { '"test string"' }, true, { "test string" } },
@@ -124,6 +127,8 @@ local encode_table_tests = {
124 127
125 { json.encode, { nested5 }, true, { '[ [ [ [ [ "nested" ] ] ] ] ]' } }, 128 { json.encode, { nested5 }, true, { '[ [ [ [ [ "nested" ] ] ] ] ]' } },
126 { json.encode, { { nested5 } }, 129 { json.encode, { { nested5 } },
130 false, { "Cannot serialise, excessive nesting (6)" } },
131 { json.encode, { table_cycle },
127 false, { "Cannot serialise, excessive nesting (6)" } } 132 false, { "Cannot serialise, excessive nesting (6)" } }
128} 133}
129 134