Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentarctagon committed Dec 12, 2023
1 parent 910c93a commit 34fd813
Show file tree
Hide file tree
Showing 101 changed files with 294 additions and 127 deletions.
67 changes: 19 additions & 48 deletions data/test/macros/wml_unit_test_macros.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,13 @@
[/if]
#enddef

#define ATTACK_AND_VALIDATE STARTX STARTY X1 Y1 X2 Y2 DAMAGE1
#define ATTACK_AND_VALIDATE DAMAGE1

#arg ID1
alice#endarg

#arg ID2
bob#endarg

#arg DAMAGE2
{DAMAGE1}#endarg
Expand All @@ -103,62 +109,27 @@
max_hitpoints = 1000
[/modify_unit]

{VARIABLE a {STARTX}}
{VARIABLE b {STARTY}}

# avoid a warning if start and end are the same coordinates
[if]
[variable]
name=a
not_equals={X1}
[/variable]
[or]
[variable]
name=b
not_equals={Y1}
[/variable]
[/or]
[then]
[do_command]
[move]
x={STARTX},{X1}
y={STARTY},{Y1}
[/move]
[/do_command]
[/then]
[/if]

[do_command]
[attack]
weapon=0
defender_weapon=0
[source]
x,y={X1},{Y1}
[/source]
[destination]
x,y={X2},{Y2}
[/destination]
[/attack]
[/do_command]
[test_do_attack_by_id]
attacker={ID1}
defender={ID2}
[/test_do_attack_by_id]

[store_unit]
[filter]
x,y={X1},{Y1}
id={ID1}
[/filter]
variable=temp1
variable={ID1}
[/store_unit]
[store_unit]
[filter]
x,y={X2},{Y2}
id={ID2}
[/filter]
variable=temp2
variable={ID2}
[/store_unit]

{ASSERT {VARIABLE_CONDITIONAL temp1.hitpoints numerical_equals "$($temp1.max_hitpoints-{DAMAGE1})"}}
{ASSERT {VARIABLE_CONDITIONAL temp2.hitpoints numerical_equals "$($temp2.max_hitpoints-{DAMAGE2})"}}
{ASSERT {VARIABLE_CONDITIONAL {ID1}.hitpoints numerical_equals "$(${ID1}.max_hitpoints-{DAMAGE1})"}}
{ASSERT {VARIABLE_CONDITIONAL {ID2}.hitpoints numerical_equals "$(${ID2}.max_hitpoints-{DAMAGE2})"}}

{CLEAR_VARIABLE temp1}
{CLEAR_VARIABLE temp2}
{CLEAR_VARIABLE a}
{CLEAR_VARIABLE b}
{CLEAR_VARIABLE {ID1}}
{CLEAR_VARIABLE {ID2}}
#enddef
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#define EXPECT_HITPOINTS leader1 healer1 leader2 healer2
[store_unit]
[filter]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]affect_allies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]affect_enemies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]affect_allies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]affect_self=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]poison=
##
Expand All @@ -20,8 +22,7 @@
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY heals 4 ([affect_adjacent][/affect_adjacent]
poison="cured") ALLIES=yes}
{TEST_ABILITY heals 4 ([affect_adjacent][/affect_adjacent]poison="cured") ALLIES=yes}
[/abilities]
[/effect]
[effect]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]poison=
##
Expand All @@ -20,8 +22,7 @@
[effect]
apply_to = new_ability
[abilities]
{TEST_ABILITY heals 4 ([affect_adjacent][/affect_adjacent]
poison="slowed") ALLIES=yes}
{TEST_ABILITY heals 4 ([affect_adjacent][/affect_adjacent]poison="slowed") ALLIES=yes}
[/abilities]
[/effect]
[effect]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]cumulative=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [heals]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]affect_allies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]affect_enemies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]affect_allies=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]affect_self=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# wmllint: no translatables

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#textdomain wesnoth-test

#####
# API(s) being tested: [regenerate]poison=
##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#textdomain wesnoth-test

#####
# API(s) being tested: [regenerate]value=
##
Expand Down
Loading

0 comments on commit 34fd813

Please sign in to comment.