diff --git a/persistence/lua_log_file.lua b/persistence/lua_log_file.lua index 602e442..91776a2 100644 --- a/persistence/lua_log_file.lua +++ b/persistence/lua_log_file.lua @@ -68,7 +68,6 @@ function init(self) return end self:open() - self.root = {} self:_write() end diff --git a/test.lua b/test.lua index 945b97e..92902fb 100644 --- a/test.lua +++ b/test.lua @@ -345,8 +345,9 @@ assert(colorspec.from_string"#694269":to_string() == "694269") -- Persistence local function test_logfile(reference_strings) - local logfile = persistence.lua_log_file.new(mod.get_resource"logfile.test.lua", {}, reference_strings) + local logfile = persistence.lua_log_file.new(mod.get_resource"logfile.test.lua", {root_preserved = true}, reference_strings) logfile:init() + assert(logfile.root.root_preserved) logfile.root = {a_longer_string = "test"} logfile:rewrite() logfile:set_root({a = 1}, {b = 2, c = 3, d = _G.math.huge, e = -_G.math.huge})