Software /
code /
prosody
Changeset
9343:e767da06399d
util.serialization: Use deserialize instead of envload directly
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 23 Sep 2018 17:02:54 +0200 |
parents | 9342:83e4596c2824 |
children | 9344:d36fa7d164c0 |
files | spec/util_serialization_spec.lua |
diffstat | 1 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/spec/util_serialization_spec.lua Sun Sep 23 16:30:35 2018 +0200 +++ b/spec/util_serialization_spec.lua Sun Sep 23 17:02:54 2018 +0200 @@ -1,5 +1,4 @@ local serialization = require "util.serialization"; -local envload = require "util.envload"; describe("util.serialization", function () describe("serialize", function () @@ -15,9 +14,8 @@ local function test(data) local serialized = serialization.serialize(data); assert.is_string(serialized); - local chunk, err = envload.envload("return ("..serialized..");"); - assert.is_function(chunk, err); - assert.same(data, chunk()); + local deserialized, err = serialization.deserialize(serialized); + assert.same(data, deserialized, err); end test({});