util.serialization: Test rejection of multiple references to same table

This commit is contained in:
Kim Alvefur 2018-10-27 12:40:47 +02:00
parent bdadc69e1a
commit 2801e1f100

View file

@ -27,6 +27,14 @@ describe("util.serialization", function ()
end);
end);
it("rejects multiple references to same table", function ()
assert.has_error(function ()
local t1 = {};
local t2 = { t1, t1 };
serialization.serialize(t2);
end);
end);
it("roundtrips", function ()
local function test(data)
local serialized = serialization.serialize(data);