aboutsummaryrefslogtreecommitdiffstats
path: root/spec/util_serialization_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util_serialization_spec.lua')
-rw-r--r--spec/util_serialization_spec.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/util_serialization_spec.lua b/spec/util_serialization_spec.lua
index f50bdf23..180a2135 100644
--- a/spec/util_serialization_spec.lua
+++ b/spec/util_serialization_spec.lua
@@ -7,9 +7,19 @@ describe("util.serialization", function ()
assert.is_string(serialization.serialize(nil));
assert.is_string(serialization.serialize(1));
assert.is_string(serialization.serialize(true));
- assert.is_string(serialization.serialize(function () end));
end);
+ it("rejects function by default", function ()
+ assert.has_error(function ()
+ serialization.serialize(function () end)
+ end);
+ end);
+
+ it("makes a string in debug mode", function ()
+ assert.is_string(serialization.serialize(function () end, "debug"));
+ end);
+
+
it("roundtrips", function ()
local function test(data)
local serialized = serialization.serialize(data);