# HG changeset patch # User Kim Alvefur # Date 1540636847 -7200 # Node ID dad29508d0f2f971b3fb72f72a57e92749ed650c # Parent 9a1e2f5f674f99b7636834fbe0675a46a40b8ec3 util.serialization: Test rejection of multiple references to same table diff -r 9a1e2f5f674f -r dad29508d0f2 spec/util_serialization_spec.lua --- a/spec/util_serialization_spec.lua Sat Oct 27 12:38:47 2018 +0200 +++ b/spec/util_serialization_spec.lua Sat Oct 27 12:40:47 2018 +0200 @@ -27,6 +27,14 @@ 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);