diff --git a/scripts/tests/e2/e2features.lua b/scripts/tests/e2/e2features.lua index cba363d83..2f8764119 100644 --- a/scripts/tests/e2/e2features.lua +++ b/scripts/tests/e2/e2features.lua @@ -39,6 +39,29 @@ function test_herbalism() assert_equal(98, r:get_resource("seed")) end +function test_dwarf_bonus() + local r = region.create(0, 0, "mountain") + r:set_resource("iron", 100) + local level = r:get_resourcelevel("iron") + assert_equal(1, level) + local u = unit.create(faction.create('test@example.com', "dwarf"), r) + assert_equal("dwarf", u.faction.race) + assert_equal("dwarf", u.race) + u.faction.name = "Zwerge" + u.number = 10 + u:set_skill("mining", 1) + u:add_order("MACHE EISEN") + process_orders() + assert_equal(30, u:get_item("iron")) + assert_equal(82, r:get_resource("iron")) + u.building = building.create(r, "mine") + u.building.size = 10 + u:add_item("money", 500) -- maintenance + process_orders() + assert_equal(70, u:get_item("iron")) + assert_equal(70, r:get_resource("iron")) +end + function test_build_harbour() -- try to reproduce mantis bug 2221 local r = region.create(0, 0, "plain")