2020-04-19 21:35:48 +02:00
|
|
|
local tcname = 'tests.regions'
|
2020-05-03 16:52:40 +02:00
|
|
|
local lunit = require('lunit')
|
2020-04-19 21:35:48 +02:00
|
|
|
if _VERSION >= 'Lua 5.2' then
|
|
|
|
_ENV = module(tcname, 'seeall')
|
|
|
|
else
|
2020-05-03 16:52:40 +02:00
|
|
|
module(tcname, lunit.testcase, package.seeall)
|
2020-04-19 21:35:48 +02:00
|
|
|
end
|
2014-08-07 13:19:19 +02:00
|
|
|
|
|
|
|
function setup()
|
|
|
|
eressea.game.reset()
|
|
|
|
conf = [[{
|
|
|
|
"terrains" : {
|
|
|
|
"ocean": {},
|
|
|
|
"plain": {}
|
|
|
|
}
|
|
|
|
}]]
|
|
|
|
eressea.config.reset()
|
|
|
|
eressea.settings.set('rules.magic.playerschools', '')
|
|
|
|
eressea.config.parse(conf)
|
|
|
|
end
|
|
|
|
|
|
|
|
function test_create()
|
|
|
|
local r
|
|
|
|
r = region.create(0, 0, "ocean")
|
|
|
|
assert_not_nil(r)
|
|
|
|
end
|