mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-25 16:53:46 +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
|
return
|
||||||
end
|
end
|
||||||
self:open()
|
self:open()
|
||||||
self.root = {}
|
|
||||||
self:_write()
|
self:_write()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
3
test.lua
3
test.lua
@ -345,8 +345,9 @@ assert(colorspec.from_string"#694269":to_string() == "694269")
|
|||||||
|
|
||||||
-- Persistence
|
-- Persistence
|
||||||
local function test_logfile(reference_strings)
|
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()
|
logfile:init()
|
||||||
|
assert(logfile.root.root_preserved)
|
||||||
logfile.root = {a_longer_string = "test"}
|
logfile.root = {a_longer_string = "test"}
|
||||||
logfile:rewrite()
|
logfile:rewrite()
|
||||||
logfile:set_root({a = 1}, {b = 2, c = 3, d = _G.math.huge, e = -_G.math.huge})
|
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