Activate serialize_lib unit tests

This commit is contained in:
Gabriel Pérez-Cerezo 2021-11-10 11:39:54 +01:00
parent 3561a7bfa2
commit 890369090e
2 changed files with 6 additions and 4 deletions

View File

@ -33,6 +33,8 @@ tasks:
busted
cd ../advtrains_interlocking
busted
cd ../serialize_lib
busted
- activate_test_env: |
cd advtrains
git merge --no-commit origin/luaatcdebug

View File

@ -10,7 +10,7 @@ ser = require("serialize")
local mock_file = {}
_G.mock_file = mock_file
function mock_file:read(arg)
if arg == "*l" then
if arg == "*l" or arg== "*line" then
local l = self.lines[self.pointer or 1]
self.pointer = (self.pointer or 1) + 1
return l
@ -49,7 +49,7 @@ local testtable = {
["es&&ca&\npe3"] = "baz&&bam&\nbim",
["es&:cape4"] = "foo\n:bar"
}
local testser = [[LUA_SER v=1
local testser = [[LUA_SER v=2
B1:T
Sa:Sb
Sc:B0
@ -81,13 +81,13 @@ local function check_read(text)
return ser.read_from_fd(f)
end
local noskip = [[LUA_SER v=1
local noskip = [[LUA_SER v=2
N1:T
E
E
END_SER
]]
local skip = [[LUA_SER v=1
local skip = [[LUA_SER v=2
E
END_SER
]]