Diff

spec/util_serialization_spec.lua @ 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
parent 9342:83e4596c2824
child 9480:006a71a83e6a
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({});