diff options
Diffstat (limited to 'tests/test.lua')
-rwxr-xr-x | tests/test.lua | 5 |
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 | |||
63 | end | 63 | end |
64 | local utf16_escaped = gen_utf16_escaped() | 64 | local utf16_escaped = gen_utf16_escaped() |
65 | local nested5 = {{{{{ "nested" }}}}} | 65 | local nested5 = {{{{{ "nested" }}}}} |
66 | local table_cycle = {} | ||
67 | local table_cycle2 = { table_cycle } | ||
68 | table_cycle[1] = table_cycle2 | ||
66 | 69 | ||
67 | local decode_simple_tests = { | 70 | local 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 | ||