From 1d7318d9b6979ca8eed0d22b21ceaa190a4a3a63 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 13 May 2018 20:33:45 +0200 Subject: [PATCH] test that new orcs have weapon skills. --- scripts/tests/e2/e2features.lua | 13 +++++++++++++ scripts/tests/e3/rules.lua | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/scripts/tests/e2/e2features.lua b/scripts/tests/e2/e2features.lua index 8fea1641a..573e3e0df 100644 --- a/scripts/tests/e2/e2features.lua +++ b/scripts/tests/e2/e2features.lua @@ -444,3 +444,16 @@ function test_faction_anonymous() assert_equal(get_name(u) .. ", 1 Mensch, aggressiv.", u:show(f)) assert_equal(get_name(u) .. ", " .. get_name(f) .. ", 1 Mensch.", u:show(f2)) end + +function test_new_orc_has_skills() + local f = faction.create('orc') + local r = region.create(0, 0, 'plain') + local u = unit.create(f, r) + u:add_item('money', 400) + u.number = 0 + u:add_order("REKRUTIEREN 2") + process_orders() + assert_equal(2, u.number) + assert_equal(1, u:get_skill('polearm')) + assert_equal(1, u:get_skill('melee')) +end diff --git a/scripts/tests/e3/rules.lua b/scripts/tests/e3/rules.lua index 5120fb747..6d3e56d1a 100644 --- a/scripts/tests/e3/rules.lua +++ b/scripts/tests/e3/rules.lua @@ -1026,3 +1026,17 @@ function test_demons_using_mallornlance() end assert_true(u.guard) end + +function test_new_orc_has_no_skills() +-- orcs in E2 get starting skills, but in E3 they do not + local f = faction.create('orc') + local r = region.create(0, 0, 'plain') + local u = unit.create(f, r) + u:add_item('money', 400) + u.number = 0 + u:add_order("REKRUTIEREN 2") + process_orders() + assert_equal(2, u.number) + assert_equal(0, u:get_skill('polearm')) + assert_equal(0, u:get_skill('melee')) +end