Tests cleanup.

This commit is contained in:
Pentarctagon 2022-12-11 15:01:03 -06:00 committed by Pentarctagon
parent 5eae1b6199
commit 129f5742fc
36 changed files with 287 additions and 315 deletions

View file

@ -41,7 +41,6 @@
{test/scenarios/lua_tests/location_set}
{test/scenarios/lua_tests/mathx}
{test/scenarios/lua_tests/stringx}
{test/scenarios/lua_tests/unit_test}
{test/scenarios/lua_tests/wesnoth}
{test/scenarios/lua_tests/wesnoth/audio}
{test/scenarios/lua_tests/wesnoth/game_events}

View file

@ -0,0 +1,66 @@
#define OBJECT_HALF_VISION
[object]
[effect]
apply_to=vision
increase=-50%
[/effect]
[/object]
#enddef
#define TEST_SHROUD_SCEN ID EVENTS
[test]
name = _ "Unit Test " + {ID}
map_file=test/maps/generic_unit_test.map
id = {ID}
is_unit_test = yes
random_start_time = no
#is_unit_test = yes
{DAWN}
[side]
side=1
controller=human
name = _ "Alice"
type = Elvish Archer
id=alice
shroud=yes
[modifications]
{OBJECT_HALF_VISION}
[/modifications]
[/side]
[side]
side=2
controller=ai
name = _ "Bob"
type = Orcish Grunt
id=bob
shroud=yes
[modifications]
{OBJECT_HALF_VISION}
[/modifications]
[/side]
{EVENTS}
[/test]
#enddef
#define ASSERT_SHROUDED FILTER STATE
[lua]
code=<<
local locs = wesnoth.map.find(wml.get_child(..., 'filter'))
local state = (...).state
for _,loc in ipairs(locs) do
local x, y = loc[1], loc[2]
unit_test.assert_equal(wesnoth.sides.is_shrouded(1, loc), state, string.format('shroud check at (%d,%d)', loc[1], loc[2]))
end
>>
[args]
[filter]
include_borders=yes
{FILTER}
[/filter]
state={STATE}
[/args]
[/lua]
#enddef

View file

@ -1,72 +1,5 @@
#textdomain wesnoth-test
#define OBJECT_HALF_VISION
[object]
[effect]
apply_to=vision
increase=-50%
[/effect]
[/object]
#enddef
#define TEST_SHROUD_SCEN ID EVENTS
[test]
name = _ "Unit Test " + {ID}
map_file=test/maps/generic_unit_test.map
id = {ID}
is_unit_test = yes
random_start_time = no
#is_unit_test = yes
{DAWN}
[side]
side=1
controller=human
name = _ "Alice"
type = Elvish Archer
id=alice
shroud=yes
[modifications]
{OBJECT_HALF_VISION}
[/modifications]
[/side]
[side]
side=2
controller=ai
name = _ "Bob"
type = Orcish Grunt
id=bob
shroud=yes
[modifications]
{OBJECT_HALF_VISION}
[/modifications]
[/side]
{EVENTS}
[/test]
#enddef
#define ASSERT_SHROUDED FILTER STATE
[lua]
code=<<
local locs = wesnoth.map.find(wml.get_child(..., 'filter'))
local state = (...).state
for _,loc in ipairs(locs) do
local x, y = loc[1], loc[2]
unit_test.assert_equal(wesnoth.sides.is_shrouded(1, loc), state, string.format('shroud check at (%d,%d)', loc[1], loc[2]))
end
>>
[args]
[filter]
include_borders=yes
{FILTER}
[/filter]
state={STATE}
[/args]
[/lua]
#enddef
#define ASSERT_SHROUD_DATA DATA
[lua]
code=<<
@ -127,27 +60,6 @@
[/event]
)}
#####
# API(s) being tested: [place_shroud]
##
# Actions:
# Place shroud on a hex.
##
# Expected end state:
# Shroud is placed on the hex.
#####
{TEST_SHROUD_SCEN test_shroud_place_wml (
[event]
name=start
[place_shroud]
side=1
x,y=7,5
[/place_shroud]
{ASSERT_SHROUDED x,y=7,5 true}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: wesnoth.sides.place_shroud
##
@ -286,27 +198,6 @@
[/event]
)}
#####
# API(s) being tested: [remove_shroud]
##
# Actions:
# Remove shroud from a hex.
##
# Expected end state:
# The shroud is removed from the specified hex.
#####
{TEST_SHROUD_SCEN test_shroud_remove_wml (
[event]
name=start
[remove_shroud]
side=1
x,y=13,8
[/remove_shroud]
{ASSERT_SHROUDED x,y=13,8 false}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: wesnoth.sides.remove_shroud
##
@ -380,41 +271,6 @@
[/event]
)}
#####
# API(s) being tested: [modify_side]shroud_data=
##
# Expected end state:
# The side's shroud is modified as specified by the shroud data string.
#####
{TEST_SHROUD_SCEN test_shroud_modify_wml (
[event]
name=start
[modify_side]
side=1
shroud_data="|
|
|
|011111
|111111
|1111111
|1111111
|11111111
|1111111
|1111111
|111111
|011111
|00111
|000111
|00111
"
[/modify_side]
{ASSERT_SHROUDED x,y=12,2-4 false}
{ASSERT_SHROUDED x,y=13,3-5 false}
{ASSERT_SHROUDED x,y=14,2-4 false}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: wesnoth.sides.shroud_data
##
@ -454,6 +310,5 @@
[/event]
)}
#undef ASSERT_SHROUDED
#undef ASSERT_SHROUD_DATA
#undef OBJECT_HALF_VISION

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested:
# API(s) being tested: SCATTER_UNITS
##
# Actions:
# Use the SCATTER_UNITS macro to place Mage units onto the map.

View file

@ -1,15 +1,22 @@
# This unit test defines a WML object based implementation of the "unupgradable" ability
# https://github.com/ProditorMagnus/Ageless-for-1-14/blob/52c1eaf31722bb58046a1b459d4f29daa8d88487/data/general_data/weapon_specials/unupgradable.cfg
# and checks that it works. What is being tested here is that
# FORCE_CHANCE_TO_HIT macro must doing misses all attacks then what [chance_to_hit] value equals 100%
# - through [attacks]
# - through [effect] increase_attacks
#####
# API(s) being tested: FORCE_CHANCE_TO_HIT
##
# Actions:
# Give alice and bob a 0% chance to hit each other with FORCE_CHANCE_TO_HIT.
# Give alice and bob a [chance_to_hit] weapon special that grants 100% hit chance.
# Give alice and bob 10 strikes each.
# Have alice attack bob.
##
# Expected end state:
# All strikes for both units miss.
#####
{GENERIC_UNIT_TEST "test_force_chance_to_hit_macro" (
{FORCE_CHANCE_TO_HIT (id=bob) (id=alice) 0 ()}
{FORCE_CHANCE_TO_HIT (id=alice) (id=bob) 0 ()}
[event]
name=start
[modify_unit]
[filter]
[/filter]
@ -17,6 +24,7 @@
hitpoints=100
attacks_left=1
[/modify_unit]
[object]
silent=yes
[effect]
@ -26,9 +34,6 @@
[attacks]
value=10
[/attacks]
[attacks]
add=13
[/attacks]
[damage]
value=1
[/damage]
@ -41,6 +46,7 @@
id=bob
[/filter]
[/object]
[object]
silent=yes
[effect]
@ -62,6 +68,7 @@
id=alice
[/filter]
[/object]
[store_unit]
[filter]
id=alice
@ -69,17 +76,20 @@
variable=a
kill=yes
[/store_unit]
[store_unit]
[filter]
id=bob
[/filter]
variable=b
[/store_unit]
[unstore_unit]
variable=a
find_vacant=yes
x,y=$b.x,$b.y
[/unstore_unit]
[store_unit]
[filter]
id=alice
@ -99,20 +109,13 @@
[/destination]
[/attack]
[/do_command]
[store_unit]
[filter]
id=alice
[/filter]
variable=a
[/store_unit]
[store_unit]
[filter]
id=bob
[/filter]
variable=b
[/store_unit]
{ASSERT ({VARIABLE_CONDITIONAL a.hitpoints equals 100})}
{ASSERT ({VARIABLE_CONDITIONAL b.hitpoints equals 100})}
{SUCCEED}
[/event]
[event]
name=attacker hits,defender hits
first_time_only=no
{FAIL}
[/event]
)}

View file

@ -1,36 +1,6 @@
#textdomain wesnoth-test
[test]
name = _ "Unit Test test_max_menu_items"
map_file=test/maps/generic_unit_test.map
turns = -1
id = test_max_menu_items
{DAWN}
[side]
side=1
controller=human
recruit=
gold=100
[leader]
name = _ "Alice"
type = Elvish Archer
id=alice
[/leader]
[/side]
[side]
side=2
controller=human
recruit=
gold=100
[leader]
name = _ "Bob"
type = Orcish Grunt
id=bob
[/leader]
[/side]
{GENERIC_UNIT_TEST "test_max_menu_items" (
[event]
name=side 1 turn
first_time_only=no
@ -149,4 +119,4 @@
description=_"foo21"
[/set_menu_item]
[/event]
[/test]
)}

View file

@ -0,0 +1,34 @@
#textdomain wesnoth-test
#####
# API(s) being tested: unit_test.fire_wml_menu_item
##
# Actions:
# Define and then manually fire a menu_item via lua.
##
# Expected end state:
# The two numeric values are used as the x1,y1 coordinates for the event.
# The menu_item is executed and sets the two WML variables to the expected values.
#####
{GENERIC_UNIT_TEST "test_wml_menu_items_1" (
[event]
name = start
[set_menu_item]
id=test1
description=_"store location"
[command]
{VARIABLE mx $x1}
{VARIABLE my $y1}
[/command]
[/set_menu_item]
[lua]
code = << unit_test.fire_wml_menu_item("test1", 3, 4) >>
[/lua]
{ASSERT {VARIABLE_CONDITIONAL mx equals 3}}
{ASSERT {VARIABLE_CONDITIONAL my equals 4}}
{SUCCEED}
[/event]
)}

View file

@ -1,7 +1,7 @@
# These are sanity checks of the unit testing mechanisms.
#####
# API(s) being tested: [if][true]
# API(s) being tested: RETURN
##
# Expected end state:
# Return true works.
@ -14,7 +14,7 @@
)}
#####
# API(s) being tested: [if][not][true]
# API(s) being tested: RETURN
##
# Expected end state:
# Return false fails.

View file

@ -26,7 +26,7 @@
#enddef
#####
# API(s) being tested: [set_specials][damage][filter_opponent] during [event]name=attack
# API(s) being tested: [set_specials][damage][filter_opponent],[event]name=attack
#
# This test is a variation of backstab_inactive_with_statue_behind_bob.
##
@ -60,7 +60,7 @@
)}
#####
# API(s) being tested: [set_specials][damage][filter_opponent] during [event]name=attack
# API(s) being tested: [set_specials][damage][filter_opponent],[event]name=attack
##
# Actions:
# Bob is made to have 0% defense and given 100 hp.

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [effect][special_note],[store_unit],unstore_unit]
# API(s) being tested: [store_unit]
##
# Actions:
# Alice is a Spectre, a unit whose 'undeadspirit' movetype includes a special note.
@ -12,7 +12,7 @@
##
# Expected end state:
# Both stored copies of Alice have their individual special note. The movetype special note
# doesn't get mixed with the individual special note.
# doesn't get mixed with the individual special note. This tests a fix for a bug which caused special note duplicates with [store_unit].
#####
#ifndef SCHEMA_VALIDATION
{GENERIC_UNIT_TEST "special_note_individual_unit" (

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [have_unit]ability_id_active
# API(s) being tested: [have_unit]ability_id_active=
##
# Actions:
# Give Alice an unconditionally active [hides] ability.

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [have_unit]ability_id_active
# API(s) being tested: [have_unit]ability_id_active=
##
# Actions:
# Give Alice a [hides] ability active only on forests.

View file

@ -107,7 +107,7 @@
#enddef
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That any side sees each other.
@ -122,7 +122,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 2 sees any side.
@ -137,7 +137,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 4 sees any side.
@ -152,7 +152,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 1 sees side 4.
@ -167,7 +167,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 2 sees side 4.
@ -182,7 +182,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 3 sees side 4.
@ -197,7 +197,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side side 4 sees side 1.
@ -212,7 +212,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 4 sees side 3.
@ -227,7 +227,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That side 4 does not see side 2.
@ -242,7 +242,7 @@
)}
#####
# API(s) being tested: [filter_vision],[filter_location][filter_vision]
# API(s) being tested: [have_unit][filter_vision],[have_unit][filter_location][filter_vision]
##
# Expected end state:
# That no side sees a non-existent side.

View file

@ -1,7 +1,7 @@
#textdomain wesnoth-test
#####
# API(s) being tested: [have_unit][has_attack],[store_unit]
# API(s) being tested: [have_unit][has_attack]
##
# Actions:
# Give bob an ability that gives adjacent allied units the swarm ability with a min and max strikes of 1, if they are Orcish Grunts.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: this_unit,[modify_unit]hitpoints=
# API(s) being tested: [modify_unit]hitpoints=
##
# Actions:
# Reduce bob's hp by half.
@ -28,7 +28,7 @@
)}
#####
# API(s) being tested: this_unit,[modify_unit]level=
# API(s) being tested: [modify_unit]level=
##
# Actions:
# Set bob's level to 2.
@ -55,7 +55,7 @@
)}
#####
# API(s) being tested: this_unit,[modify_unit]moves=
# API(s) being tested: [modify_unit]moves=
##
# Actions:
# Set bob's movement to 3.
@ -82,7 +82,7 @@
)}
#####
# API(s) being tested: this_unit,[modify_unit]moves=
# API(s) being tested: [modify_unit]moves=
##
# Actions:
# Set bob's movement to 3.

View file

@ -70,7 +70,7 @@
#enddef
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.
@ -83,7 +83,7 @@
{MOVE_SKIP_SIGHTED_SCEN move_skip_no_sighted_no_share_vision 15 3 no none}
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.
@ -96,7 +96,7 @@
{MOVE_SKIP_SIGHTED_SCEN move_skip_ally_sighted_no_share_vision 12 3 only_ally none}
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.
@ -109,7 +109,7 @@
{MOVE_SKIP_SIGHTED_SCEN move_skip_all_sighted_no_share_vision 11 3 all none}
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.
@ -122,7 +122,7 @@
{MOVE_SKIP_SIGHTED_SCEN move_skip_no_sighted_yes_share_vision 11 3 no all}
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.
@ -135,7 +135,7 @@
{MOVE_SKIP_SIGHTED_SCEN move_skip_ally_sighted_yes_share_vision 11 3 only_ally all}
#####
# API(s) being tested: [move]skip_sighted=,[side]share_vision=
# API(s) being tested: [move]skip_sighted=
##
# Actions:
# Move a unit from 16,3 to 11,3.

View file

@ -5,7 +5,7 @@
# which needs to be handled within the WML API.
#####
# API(s) being tested: [put_to_recall_list], [modify_unit], [role][auto_recall]
# API(s) being tested: [put_to_recall_list],[modify_unit],[role][auto_recall]
##
# Actions:
# Create Charlie, belonging to side 1, on the map.

View file

@ -0,0 +1,79 @@
#textdomain wesnoth-test
#####
# API(s) being tested: [place_shroud]
##
# Actions:
# Place shroud on a hex.
##
# Expected end state:
# Shroud is placed on the hex.
#####
{TEST_SHROUD_SCEN test_shroud_place_wml (
[event]
name=start
[place_shroud]
side=1
x,y=7,5
[/place_shroud]
{ASSERT_SHROUDED x,y=7,5 true}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: [remove_shroud]
##
# Actions:
# Remove shroud from a hex.
##
# Expected end state:
# The shroud is removed from the specified hex.
#####
{TEST_SHROUD_SCEN test_shroud_remove_wml (
[event]
name=start
[remove_shroud]
side=1
x,y=13,8
[/remove_shroud]
{ASSERT_SHROUDED x,y=13,8 false}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: [modify_side]shroud_data=
##
# Expected end state:
# The side's shroud is modified as specified by the shroud data string.
#####
{TEST_SHROUD_SCEN test_shroud_modify_wml (
[event]
name=start
[modify_side]
side=1
shroud_data="|
|
|
|011111
|111111
|1111111
|1111111
|11111111
|1111111
|1111111
|111111
|011111
|00111
|000111
|00111
"
[/modify_side]
{ASSERT_SHROUDED x,y=12,2-4 false}
{ASSERT_SHROUDED x,y=13,3-5 false}
{ASSERT_SHROUDED x,y=14,2-4 false}
{SUCCEED}
[/event]
)}

View file

@ -15,7 +15,7 @@
# have the side-effect of moving it to the correct side's recall list.
#####
# API(s) being tested: [modify_unit],[role][auto_recall]
# API(s) being tested: [modify_unit]
##
# Actions:
# Create Charlie, belonging to side 1, on the recall list.

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [move_unit]to_location
# API(s) being tested: [move_unit]to_location=
##
# Actions:
# Try to move Alice to the hex that Bob already occupies.

View file

@ -1,38 +1,5 @@
#textdomain wesnoth-test
#####
# API(s) being tested: unit_test.fire_wml_menu_item,[set_menu_item]
##
# Actions:
# Define and then manually fire a menu_item via lua.
##
# Expected end state:
# The two numeric values are used as the x1,y1 coordinates for the event.
# The menu_item is executed and sets the two WML variables to the expected values.
#####
{GENERIC_UNIT_TEST "test_wml_menu_items_1" (
[event]
name = start
[set_menu_item]
id=test1
description=_"store location"
[command]
{VARIABLE mx $x1}
{VARIABLE my $y1}
[/command]
[/set_menu_item]
[lua]
code = << unit_test.fire_wml_menu_item("test1", 3, 4) >>
[/lua]
{ASSERT {VARIABLE_CONDITIONAL mx equals 3}}
{ASSERT {VARIABLE_CONDITIONAL my equals 4}}
{SUCCEED}
[/event]
)}
#####
# API(s) being tested: [set_menu_item][filter_location]
##
@ -98,7 +65,7 @@
#
#####
# API(s) being tested: [set_menu_item][show_if],unit_test.fire_wml_menu_item
# API(s) being tested: [set_menu_item][show_if]
##
# Actions:
# Define a menu_item that is not shown if a unit exists at the provided coordinates and which spawns a unit at those coordinates when fired.

View file

@ -1 +0,0 @@
git doesn't allow adding empty directories; delete this once any test is added

View file

@ -104,7 +104,7 @@
)}
#####
# API(s) being tested: [fire_event], [break]
# API(s) being tested: [fire_event],[break]
##
# Expected end state:
# [break] outside a loop is documented to be the same as [return], so skips the entire rest of the firing event, not just fired event.
@ -190,7 +190,7 @@
)}
#####
# API(s) being tested: [fire_event], [return]
# API(s) being tested: [fire_event],[return]
##
# Expected end state:
# [return] skips the entire rest of the firing event, not just fired event.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: [role],[recall]role=
# API(s) being tested: [recall]role=
##
# Actions:
# Spawn some units into the recall list.

View file

@ -109,7 +109,7 @@
)}
#####
# API(s) being tested: [event][event],[unstore_unit]fire_event
# API(s) being tested: [event][event],[unstore_unit]fire_event=
##
# Actions:
# Create a unit
@ -305,7 +305,7 @@
)}
#####
# API(s) being tested: [event][fire_event]id
# API(s) being tested: [event][fire_event]id=
##
# Actions:
# Define a custom event
@ -357,7 +357,7 @@
)}
#####
# API(s) being tested: [event]delayed_variable_substitution=yes, name=$variable
# API(s) being tested: [event]delayed_variable_substitution=yes,[event]name=$variable
##
# Actions:
# Define a nested event with delayed_variable_substitution=yes and a dynamic name
@ -393,7 +393,7 @@
)}
#####
# API(s) being tested: [event]delayed_variable_substitution
# API(s) being tested: [event]delayed_variable_substitution=
##
# Actions:
# Define a nested event with delayed_variable_substitution=no
@ -418,7 +418,7 @@
)}
#####
# API(s) being tested: [event]delayed_variable_substitution=no, name=$variable
# API(s) being tested: [event]delayed_variable_substitution=no,[event]name=$variable
##
# Actions:
# Define a nested event with delayed_variable_substitution=no and a dynamic name
@ -599,7 +599,7 @@
)}
#####
# API(s) being tested: [event]first_time_only
# API(s) being tested: [event]first_time_only=
##
# Actions:
# Define a nested event with first_time_only=no

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [filter_condition][variable]
# API(s) being tested: [event][filter_condition][variable]
##
# Actions:
# Define three moveto events that only trigger if the [filter_condition] matches.
@ -66,7 +66,7 @@
)}
#####
# API(s) being tested: [filter_side]
# API(s) being tested: [event][filter_side]
##
# Actions:
# Define two moveto events that will only trigger if the [filter_side] matches.
@ -121,7 +121,7 @@
)}
#####
# API(s) being tested: [filter],[filter_second]
# API(s) being tested: [event][filter],[event][filter_second]
##
# Actions:
# Define three recruit events, two filtering on the recruit unit type and another on the race with [filter_second]
@ -182,7 +182,7 @@
) (SIDE1_RECRUIT=Peasant,Woodsman)}
#####
# API(s) being tested: [filter_attack],[filter_second_attack]
# API(s) being tested: [event][filter_attack],[event][filter_second_attack]
##
# Actions:
# Define events filtering on the damage dealt by the attacker or defender.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: [store_unit]
# API(s) being tested: N/A
##
# Expected end state:
# alice needs 44 xp to level up.

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [damage]+[filter_opponent]formula
# API(s) being tested: [damage][filter_opponent]formula=
##
# Actions:
# Bob is made to have 0% defense and given 100 hp.
@ -15,7 +15,7 @@
{GENERIC_BACKSTAB_TEST "backstab_active_with_accomplice_behind_bob" "n,s" yes ()}
#####
# API(s) being tested: [damage]+[filter_opponent]formula
# API(s) being tested: [damage][filter_opponent]formula=
##
# Actions:
# Bob is made to have 0% defense and given 100 hp.
@ -29,7 +29,7 @@
{GENERIC_BACKSTAB_TEST "backstab_inactive_with_triangular_formation" "n,se,sw" no ()}
#####
# API(s) being tested: [damage]+[filter_opponent]formula
# API(s) being tested: [damage][filter_opponent]formula=
##
# Actions:
# Bob is made to have 0% defense and given 100 hp.
@ -49,7 +49,7 @@
)}
#####
# API(s) being tested: [damage]+[filter_opponent]formula
# API(s) being tested: [damage][filter_opponent]formula=
##
# Actions:
# Bob is made to have 0% defense and given 100 hp.

View file

@ -1,7 +1,7 @@
#textdomain wesnoth-test
#####
# API(s) being tested: [filter_second_weapon]special_id_active=
# API(s) being tested: [leadership][filter_second_weapon]special_id_active=
##
# Actions:
# Spawn an Elvish Hero and an Orcish Warrior.

View file

@ -1,7 +1,7 @@
#textdomain wesnoth-test
#####
# API(s) being tested: [filter_second_weapon]special_id_active=
# API(s) being tested: [leadership][filter_second_weapon]special_id_active=
##
# Actions:
# Spawn an Elvish Hero and an Orcish Warrior.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: [filter_opponent][filter_weapon]special_id_active=
# API(s) being tested: [attacks][filter_opponent][filter_weapon]special_id_active=
##
# Actions:
# Give bob an attacks ability which is active when the opponent has an ability with a specific id.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: [filter_opponent][filter_weapon]special_id_active=
# API(s) being tested: [attacks][filter_opponent][filter_weapon]special_id_active=
##
# Actions:
# Give bob an attacks ability which is active when the opponent has an ability with a specific id.

View file

@ -1,5 +1,5 @@
#####
# API(s) being tested: [filter_student]
# API(s) being tested: [attacks][filter_student]
##
# Actions:
# Give alice a weapon special ability where the student's strikes are set to 10 for the blade damage type.

View file

@ -1,7 +1,7 @@
#textdomain wesnoth-test
#####
# API(s) being tested: [filter_student]
# API(s) being tested: [swarm][filter_student]
##
# Actions:
# Give bob an ability that gives adjacent allied units the swarm ability with a min and max strikes of 1, if they are Orcish Grunts.

View file

@ -1,7 +1,7 @@
# wmllint: no translatables
#####
# API(s) being tested: [movetype][special_note],[store_unit],[unstore_unit]
# API(s) being tested: [store_unit]
##
# Actions:
# Alice is a Spectre, a unit whose 'undeadspirit' movetype includes a special note.
@ -11,7 +11,7 @@
##
# Expected end state:
# Both stored copies of Alice have no special notes, because they are a part of the movetype
# rather than a part of the unit.
# rather than a part of the unit. This tests a fix for a bug which caused special note duplicates with [store_unit].
#####
{GENERIC_UNIT_TEST "special_note_from_movetype" (
[event]

View file

@ -333,7 +333,7 @@
#enddef
#####
# API(s) being tested: [find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its default movetype.
@ -341,7 +341,7 @@
#####
{MOVETYPE_MOVE_SCEN test_elf_movement (Elvish Archer) (1,1,2,2,3,2,2,3,1,1,1,3,1) {ORC_COSTS} ()}
#####
# API(s) being tested: [find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Orcish Grunt (alice) has the expected movement costs per terrain based on its default movetype.
@ -349,7 +349,7 @@
#####
{MOVETYPE_MOVE_SCEN test_orc_movement (Orcish Grunt) {ORC_COSTS} {ORC_COSTS} ()}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of caves set to 1.
@ -357,7 +357,7 @@
#####
{MOVETYPE_MOVE_SCEN test_elf_fast_cave_movement (Elvish Archer) (1,1,2,2,2,2,2,2,1,1,1,3,1) {ORC_COSTS} {SET_MOVE_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of hills set to 1.
@ -365,7 +365,7 @@
#####
{MOVETYPE_MOVE_SCEN test_elf_fast_hills_movement (Elvish Archer) (1,1,1,1,3,2,2,3,1,1,1,3,1) {ORC_COSTS} {SET_MOVE_COSTS hills=1}}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of caves and hills set to 1.
@ -373,7 +373,7 @@
#####
{MOVETYPE_MOVE_SCEN test_elf_fast_cave_and_hills_movement (Elvish Archer) (1,1,1,1,1,2,2,2,1,1,1,3,1) {ORC_COSTS} ({SET_MOVE_COSTS cave=1}{SET_MOVE_COSTS hills=1})}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Orcish Grunt (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of caves set to 1.
@ -381,7 +381,7 @@
#####
{MOVETYPE_MOVE_SCEN test_orc_fast_cave_movement (Orcish Grunt) (1,2,2,1,1,2,2,2,1,1,1,3,1) {ORC_COSTS} {SET_MOVE_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Orcish Grunt (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of forests set to 1.
@ -389,7 +389,7 @@
#####
{MOVETYPE_MOVE_SCEN test_orc_fast_forest_movement (Orcish Grunt) (1,1,1,1,2,2,2,2,1,1,1,3,1) {ORC_COSTS} {SET_MOVE_COSTS forest=1}}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of caves set to 4.
@ -398,7 +398,7 @@
{MOVETYPE_MOVE_SCEN test_elf_slow_cave_movement (Elvish Archer) (1,1,2,2,4,2,2,4,1,1,1,3,1) {ORC_COSTS} {SET_MOVE_COSTS cave=4}}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its default movetype.
@ -407,7 +407,7 @@
#####
{MOVETYPE_MOVE_SCEN test_elf_longsighted_movement (Elvish Archer) (1,1,2,2,3,2,2,3,1,1,1,3,1) {ORC_COSTS} {SET_VISION_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Orcish Grunt (alice) has the expected movement costs per terrain based on its default movetype.
@ -416,7 +416,7 @@
#####
{MOVETYPE_MOVE_SCEN test_orc_longsighted_movement (Orcish Grunt) {ORC_COSTS} {ORC_COSTS} {SET_VISION_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of cave set to 1.
@ -428,7 +428,7 @@
{SET_MOVE_COSTS cave=1}
)}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[effect]apply_to=movement_costs,[find_path]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected movement costs per terrain based on its modified movetype with the movement cost of cave set to 1.
@ -442,21 +442,21 @@
)}
#####
# API(s) being tested: [store_locations][filter_vision]
# API(s) being tested: N/A
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on its default movetype.
#####
{MOVETYPE_VISION_SCEN test_elf_vision (Elvish Archer) (1,1,2,2,3,2,2,3,1,1,1,3,1) ()}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[store_locations][filter_vision]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on its modified movetype with the movement cost of cave set to 1.
#####
{MOVETYPE_VISION_SCEN test_elf_fast_cave_vision (Elvish Archer) (1,1,2,2,2,2,2,2,1,1,1,3,1) {SET_MOVE_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=movement_costs,[store_locations][filter_vision]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on its modified movetype with the movement cost of hills set to 1.
@ -464,14 +464,14 @@
{MOVETYPE_VISION_SCEN test_elf_fast_hills_vision (Elvish Archer) (1,1,1,1,3,2,2,3,1,1,1,3,1) {SET_MOVE_COSTS hills=1}}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[store_locations][filter_vision]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on the vision cost alone of cave being set to 1.
#####
{MOVETYPE_VISION_SCEN test_elf_longsighted_cave_vision (Elvish Archer) (1,1,2,2,2,2,2,2,1,1,1,3,1) {SET_VISION_COSTS cave=1}}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[store_locations][filter_vision]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on the vision cost alone of cave and hills being set to 1.
@ -481,7 +481,7 @@
{SET_VISION_COSTS hills=1}
)}
#####
# API(s) being tested: [effect]apply_to=vision_costs,[effect]apply_to=movement_costs,[store_locations][filter_vision]
# API(s) being tested: [movetype]
##
# Expected end state:
# The Elvish Archer (alice) has the expected vision costs per terrain based on its modified movetype with the movement cost of cave set to 4 while the vision cost of cave is set to 1.