mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-18 21:11:07 +00:00
Add a unit test for the event-handler reordering bug
This test would fail without the fix from the previous commit.
This commit is contained in:
parent
508859cfb6
commit
87b42c404b
|
@ -0,0 +1,40 @@
|
|||
# wmllint: no translatables
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event]priority=
|
||||
##
|
||||
# Actions:
|
||||
# In a normal-priority start event, add a high priority start event.
|
||||
# Check that the normal-priority start event only ran once.
|
||||
##
|
||||
# Expected end state:
|
||||
# The test passes when the normal priority start event is only run once.
|
||||
#####
|
||||
{GENERIC_UNIT_TEST "events_test_priority_in_same_name" (
|
||||
[event]
|
||||
name = prestart
|
||||
{VARIABLE X 1}
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name = start
|
||||
first_time_only = no
|
||||
{ASSERT ({VARIABLE_CONDITIONAL X equals 1})}
|
||||
{VARIABLE X 2}
|
||||
|
||||
# Add a high-priority event with the same name as the event that's
|
||||
# being triggered, which in 1.17.24 caused the events list to be
|
||||
# reordered, and the current event (the normal priority one) to trigger
|
||||
# again.
|
||||
[event]
|
||||
name = start
|
||||
priority = 1
|
||||
{VARIABLE X 2}
|
||||
[/event]
|
||||
[/event]
|
||||
|
||||
[event]
|
||||
name = side turn
|
||||
{SUCCEED}
|
||||
[/event]
|
||||
)}
|
|
@ -484,6 +484,7 @@
|
|||
0 order_of_variable_events3
|
||||
0 premature_end_turn1
|
||||
2 premature_end_turn2
|
||||
0 events_test_priority_in_same_name
|
||||
0 events_test_priority_vs_origin
|
||||
0 events_test_same_priority
|
||||
0 events_test_multi_int
|
||||
|
|
Loading…
Reference in New Issue
Block a user