aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2021-11-10 11:39:54 +0100
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2021-11-10 11:39:54 +0100
commit890369090e64379ac1c175ff3ae8eeec99435f90 (patch)
tree86cc364ea979c1253e6b15beee187e2cafb752bb
parent3561a7bfa2e3ed6690c359c052cf056652df4deb (diff)
downloadadvtrains-890369090e64379ac1c175ff3ae8eeec99435f90.tar.gz
advtrains-890369090e64379ac1c175ff3ae8eeec99435f90.tar.bz2
advtrains-890369090e64379ac1c175ff3ae8eeec99435f90.zip
Activate serialize_lib unit tests
-rw-r--r--.build.yml2
-rw-r--r--serialize_lib/spec/serialize_spec.lua (renamed from serialize_lib/tests/serialize_spec.lua)8
2 files changed, 6 insertions, 4 deletions
diff --git a/.build.yml b/.build.yml
index 9627b14..303348f 100644
--- a/.build.yml
+++ b/.build.yml
@@ -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
diff --git a/serialize_lib/tests/serialize_spec.lua b/serialize_lib/spec/serialize_spec.lua
index ccc3a67..016634e 100644
--- a/serialize_lib/tests/serialize_spec.lua
+++ b/serialize_lib/spec/serialize_spec.lua
@@ -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
]]