Added a new unit test for [role]

This commit is contained in:
Elvish_Hunter 2015-06-10 22:07:28 +02:00
parent f290a865fc
commit 1b239aa3e6
2 changed files with 95 additions and 0 deletions

View file

@ -0,0 +1,92 @@
{GENERIC_UNIT_TEST "test_role_1" (
[event]
name=prestart
# create a bunch of units in side 1 recall list
{UNIT 1 Ghost recall recall (id=wrong_0)}
{UNIT 1 Shadow recall recall (id=wrong_1)}
{UNIT 1 Spectre recall recall (id=correct)}
{UNIT 1 Wraith recall recall (id=wrong_2)}
{UNIT 1 Nightgaunt recall recall (id=wrong_3)}
[/event]
[event]
name=start
[role]
role=advisor
side=1
type=Spectre,Nightgaunt,Wraith,Shadow,Ghost
[/role]
[recall]
role=advisor
[/recall]
{ASSERT (
[have_unit]
side=1
role=advisor
type=Spectre
id=correct
search_recall_list=no
[/have_unit]
)}
{RETURN ([true][/true])}
[/event]
)}
{GENERIC_UNIT_TEST "test_role_2" (
[event]
name=prestart
# create a bunch of units on field for side 2
{UNIT 2 "Troll Whelp" 13 2 (id=wrong_0)}
{UNIT 2 Troll 12 2 (id=wrong_1)}
{UNIT 2 "Troll Shaman" 14 2 (id=correct)}
{UNIT 2 "Troll Warrior" 12 3 (id=wrong_2)}
{UNIT 2 "Troll Rocklobber" 14 3 (id=wrong_3)}
[/event]
[event]
name=start
[role]
role=smart
side=2
type=Troll Shaman,Troll Warrior,Troll Rocklobber,Troll,Troll Whelp
[/role]
{ASSERT (
[have_unit]
side=2
role=smart
type=Troll Shaman
id=correct
search_recall_list=no
[/have_unit]
)}
{RETURN ([true][/true])}
[/event]
)}
{GENERIC_UNIT_TEST "test_role_3" (
[event]
name=start
[role]
role=dummy
side=3
[/role]
{ASSERT (
[have_unit]
role=dummy
count=0
search_recall_list=yes
[/have_unit]
)}
{RETURN ([true][/true])}
[/event]
)}

View file

@ -87,6 +87,9 @@
0 xp_mod_1
0 xp_mod_2
0 xp_mod_3
0 test_role_1
0 test_role_2
0 test_role_3
#
# LUA
#