server/scripts/tests/xmas.lua
Enno Rehling 42f1030251 separate test script for E4:
even though it has mostly the same rules, it does not have xmastrees, and loads a different config
remove dead `inactivefaction` function, we have no use for the file it creates.
2015-09-12 14:10:08 +02:00

20 lines
551 B
Lua

local function use_tree(terrain)
local r = region.create(0,0, terrain)
local f = faction.create("noreply@eressea.de", "human", "de")
local u1 = unit.create(f, r, 5)
r:set_resource("tree", 0)
u1:add_item("xmastree", 1)
u1:clear_orders()
u1:add_order("BENUTZEN 1 Weihnachtsbaum")
process_orders()
return r
end
function test_xmastree()
local r
r = use_tree("ocean")
assert_equal(0, r:get_resource("tree"))
eressea.free_game()
r = use_tree("plain")
assert_equal(10, r:get_resource("tree"))
end