2014-06-13 02:41:03 +02:00
|
|
|
require "lunit"
|
|
|
|
|
|
|
|
module("tests.eressea.config", package.seeall, lunit.testcase )
|
|
|
|
|
|
|
|
function setup()
|
|
|
|
eressea.free_game()
|
|
|
|
end
|
|
|
|
|
2014-06-13 17:04:06 +02:00
|
|
|
function test_read_race()
|
2014-06-13 02:41:03 +02:00
|
|
|
local f
|
2014-06-14 02:36:05 +02:00
|
|
|
eressea.free_game()
|
2014-06-13 02:41:03 +02:00
|
|
|
assert_not_nil(eressea.config)
|
|
|
|
eressea.config.parse('{ "races": { "orc" : {}}}')
|
2017-03-17 22:31:59 +01:00
|
|
|
f = faction.create("orc", "orc@example.com", "en")
|
2014-06-13 02:41:03 +02:00
|
|
|
assert_not_nil(f)
|
|
|
|
end
|
|
|
|
|
2016-10-31 20:36:05 +01:00
|
|
|
function disable_test_read_ship()
|
2014-06-13 17:04:06 +02:00
|
|
|
local s
|
2014-06-14 02:36:05 +02:00
|
|
|
eressea.free_game()
|
2014-06-13 17:04:06 +02:00
|
|
|
assert_not_nil(eressea.config)
|
|
|
|
conf = [[{
|
|
|
|
"ships": {
|
|
|
|
"boat" : {
|
|
|
|
"construction" : {
|
|
|
|
"maxsize" : 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}]]
|
|
|
|
eressea.config.parse(conf);
|
|
|
|
s = ship.create(nil, "boat")
|
|
|
|
assert_not_nil(s)
|
|
|
|
end
|