diff options
author | Kim Alvefur <zash@zash.se> | 2018-10-11 22:48:08 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-10-11 22:48:08 +0200 |
commit | 9f101c6ca3f02670ae87acd9fe62cd7021ddd597 (patch) | |
tree | 3a583a4166cda101a1dce5935cf7ac438198fc2a | |
parent | 71a12130dea87656d39d456c5811b6c6ce86b532 (diff) | |
download | prosody-9f101c6ca3f02670ae87acd9fe62cd7021ddd597.tar.gz prosody-9f101c6ca3f02670ae87acd9fe62cd7021ddd597.zip |
util.serialization: Test that it rejects tables wit cycles
-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) |