diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util_serialization_spec.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/util_serialization_spec.lua b/spec/util_serialization_spec.lua index 180a2135..8783e636 100644 --- a/spec/util_serialization_spec.lua +++ b/spec/util_serialization_spec.lua @@ -19,6 +19,13 @@ describe("util.serialization", function () assert.is_string(serialization.serialize(function () end, "debug")); end); + it("rejects cycles", function () + assert.has_error(function () + local t = {} + t[t] = { t }; + serialization.serialize(t) + end); + end); it("roundtrips", function () local function test(data) |