mirror of
https://github.com/appgurueu/modlib.git
synced 2024-12-22 21:32:27 +01:00
lua_log_file:init(): preserve root
This commit is contained in:
parent
259f28c886
commit
fe9a55505b
@ -68,7 +68,6 @@ function init(self)
|
||||
return
|
||||
end
|
||||
self:open()
|
||||
self.root = {}
|
||||
self:_write()
|
||||
end
|
||||
|
||||
|
3
test.lua
3
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})
|
||||
|
Loading…
Reference in New Issue
Block a user