Skip to content

Commit

Permalink
add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
newfrenchy83 committed Oct 11, 2024
1 parent 76a0e46 commit a2a7a96
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 0 deletions.
138 changes: 138 additions & 0 deletions data/test/scenarios/wml_tests/ScenarioWML/add_advancements.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,141 @@
{SUCCEED}
[/event]
)}

#####
# API(s) being tested: [modify_unit_type][advancement]
##
# Actions:
# Modify the cavalier unit type to add add_level amla.
# Spawn a cavalier unit.
# Make advances cavalier
##
# Expected end state:
# The spawned cavalier should have level=4.
#####
{GENERIC_UNIT_TEST "add_or_replace_amla" (
[modify_unit_type]
type="Cavalier"
[advancement]
id = add_level
[effect]
apply_to = level
increase=1
[/effect]
[/advancement]
[/modify_unit_type]
[event]
name=start
[unit]
x = 1
y = 1
type = Cavalier
side = 1
id = charlie
canrecruit = no
[/unit]
{ADVANCE_UNIT id=charlie ""}
[store_unit]
variable=cavalier
[filter]
id = charlie
[/filter]
[/store_unit]
{ASSERT ({VARIABLE_CONDITIONAL cavalier.level equals 4})}
{SUCCEED}
[/event]
)}

#####
# API(s) being tested: [modify_unit_type][female][advancement]
##
# Actions:
# Modify the Elvish Sharpshooter unit type to add add_level amla to female only.
# Spawn a Elvish Sharpshooter female unit.
# Make advances Elvish Sharpshooter
##
# Expected end state:
# The spawned Elvish Sharpshooter should have level=4.
#####
{GENERIC_UNIT_TEST "add_specific_female_amla_on_female" (
[modify_unit_type]
type="Elvish Sharpshooter"
[female]
[advancement]
id = add_level
[effect]
apply_to = level
increase=1
[/effect]
[/advancement]
[/female]
[/modify_unit_type]
[event]
name=start
[unit]
x = 1
y = 1
type = Elvish Sharpshooter
gender=female
side = 1
id = charlie
canrecruit = no
[/unit]
{ADVANCE_UNIT id=charlie ""}
[store_unit]
variable=sharpshooter
[filter]
id = charlie
[/filter]
[/store_unit]
{ASSERT ({VARIABLE_CONDITIONAL sharpshooter.level equals 4})}
{SUCCEED}
[/event]
)}

#####
# API(s) being tested: [modify_unit_type][female][advancement]
##
# Actions:
# Modify the Elvish Sharpshooter unit type to add add_level amla to female only.
# Spawn a Elvish Sharpshooter male unit.
# Make advances Elvish Sharpshooter
##
# Expected end state:
# The spawned Elvish Sharpshooter level=3 because don't have female advancement.
#####
{GENERIC_UNIT_TEST "add_specific_female_amla_on_male" (
[modify_unit_type]
type="Elvish Sharpshooter"
[female]
[advancement]
id = add_level
[effect]
apply_to = level
increase=1
[/effect]
[/advancement]
[/female]
[/modify_unit_type]
[event]
name=start
[unit]
x = 1
y = 1
type = Elvish Sharpshooter
gender= male
side = 1
id = charlie
canrecruit = no
[/unit]
{ADVANCE_UNIT id=charlie ""}
[store_unit]
variable=sharpshooter
[filter]
id = charlie
[/filter]
[/store_unit]
{ASSERT ({VARIABLE_CONDITIONAL sharpshooter.level equals 3})}
{SUCCEED}
[/event]
)}
3 changes: 3 additions & 0 deletions wml_test_schedule
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@
0 test_attacks_used
0 no_duplicate_advancements
0 add_advancement
0 add_or_replace_amla
0 add_specific_female_amla_on_female
0 add_specific_female_amla_on_male
0 harm_unit_survivable_experience_no
0 harm_unit_survivable_experience_unset
0 harm_unit_survivable_experience_yes
Expand Down

0 comments on commit a2a7a96

Please sign in to comment.