mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 14:17:37 +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 serialization = require "util.serialization";
|
||||||
local envload = require "util.envload";
|
|
||||||
|
|
||||||
describe("util.serialization", function ()
|
describe("util.serialization", function ()
|
||||||
describe("serialize", function ()
|
describe("serialize", function ()
|
||||||
|
@ -15,9 +14,8 @@ describe("util.serialization", function ()
|
||||||
local function test(data)
|
local function test(data)
|
||||||
local serialized = serialization.serialize(data);
|
local serialized = serialization.serialize(data);
|
||||||
assert.is_string(serialized);
|
assert.is_string(serialized);
|
||||||
local chunk, err = envload.envload("return ("..serialized..");");
|
local deserialized, err = serialization.deserialize(serialized);
|
||||||
assert.is_function(chunk, err);
|
assert.same(data, deserialized, err);
|
||||||
assert.same(data, chunk());
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test({});
|
test({});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue