Merge branch 'master' of git://github.com/eressea/server

This commit is contained in:
Thomas Troeger 2014-02-16 00:55:17 +01:00
commit 10434706f6
1 changed files with 28 additions and 0 deletions

View File

@ -48,6 +48,34 @@ function setup()
eressea.settings.set("rules.peasants.growth", "1") eressea.settings.set("rules.peasants.growth", "1")
end end
function test_elvenhorse_requires_riding_5()
local r = region.create(0, 0, "plain")
region.create(1, 0, "plain")
local goal = region.create(2, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u:add_item("elvenhorse", 1)
u:set_skill("riding", 5)
u:clear_orders()
u:add_order("NACH O O")
process_orders()
assert_equal(goal, u.region)
end
function test_cannot_ride_elvenhorse_without_enough_skill()
local r = region.create(0, 0, "plain")
local goal = region.create(1, 0, "plain")
region.create(2, 0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u:add_item("elvenhorse", 1)
u:set_skill("riding", 4)
u:clear_orders()
u:add_order("NACH O O")
process_orders()
assert_equal(goal, u.region)
end
function test_no_peasant_growth() function test_no_peasant_growth()
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")
r:set_resource("peasant", 2000) r:set_resource("peasant", 2000)