mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
util.serialization: Use deserialize instead of envload directly
This commit is contained in:
parent
31cf61bea4
commit
42cc508a5d
1 changed files with 2 additions and 4 deletions
|
@ -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 @@ describe("util.serialization", function ()
|
|||
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({});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue