From f1217ed7a9dab167cf27a398939d29065012d95b Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 8 Jul 2015 16:11:25 +0200 Subject: [PATCH] Bug 1965: verify that buildings cannot be built on packice. --- scripts/tests/e3/castles.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/scripts/tests/e3/castles.lua b/scripts/tests/e3/castles.lua index 1aa2bb17c..b9cbabe0b 100644 --- a/scripts/tests/e3/castles.lua +++ b/scripts/tests/e3/castles.lua @@ -25,3 +25,28 @@ function test_small_castles() assert_equal("site", b:get_typename(9)) assert_equal("fortification", b:get_typename(10)) end + +function test_build_normal() + local r = region.create(0, 0, "plain") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + u:clear_orders() + u:add_item("stone", 10) + u:set_skill("building", 10) + u:add_order("MACHE BURG") + process_orders() + assert_not_nil(u.building) + assert_equal(10, u.building.size) +end + +function test_build_packice() + local r = region.create(0, 0, "packice") + local f = faction.create("noreply@eressea.de", "human", "de") + local u = unit.create(f, r, 1) + u:clear_orders() + u:add_item("stone", 10) + u:set_skill("building", 10) + u:add_order("MACHE BURG") + process_orders() + assert_equal(nil, u.building) +end