BUG 2505 proof by test.

This commit is contained in:
Enno Rehling 2018-10-28 21:48:52 +01:00
parent dce5f7857b
commit 6326664b86
2 changed files with 30 additions and 0 deletions

View file

@ -1058,6 +1058,21 @@ function test_give_silver()
assert_equal(10, u:get_item("money")) assert_equal(10, u:get_item("money"))
end end
function test_build_castle_one_stage()
local r = region.create(0, 0, 'plain')
local f = faction.create('human')
local u = unit.create(f, r, 2)
u:add_item('stone', 4)
u:set_skill('building', 1)
u:add_order('MACHE BURG')
process_orders()
assert_equal(2, u.building.size)
assert_equal(2, u:get_item('stone'))
end
function test_build_castle() function test_build_castle()
local r = region.create(0, 0, "plain") local r = region.create(0, 0, "plain")
local f = create_faction('human') local f = create_faction('human')

View file

@ -29,6 +29,21 @@ function test_castle_names()
assert_equal("citadel", b:get_typename(6250)) assert_equal("citadel", b:get_typename(6250))
end end
function test_build_castle_one_stage()
local r = region.create(0, 0, 'plain')
local f = faction.create('human')
local u = unit.create(f, r, 2)
u:add_item('stone', 4)
u:set_skill('building', 1)
u:add_order('MACHE BURG')
process_orders()
assert_equal(2, u.building.size)
assert_equal(2, u:get_item('stone'))
end
function test_build_castle_stages() function test_build_castle_stages()
local r = region.create(0,0, "plain") local r = region.create(0,0, "plain")
local f = faction.create("human") local f = faction.create("human")