mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 16:28:40 +00:00

Adding this is issue 2 of #4177, changing the behavior when [find_path] is given a SLF which matches multiple hexes. The map and tests here should be easy enough for manually editing them. It duplicates some of the functionality of the existing characterize_pathfinding tests, however those tests need their expected values to be calculated and can't be changed by hand. '''nearest_by''': {DevFeature1.15|2} possible values "movement_cost" (default), "steps", "hexes". If the [destination] SLF matches multiple hexes, the one that would need the least movement points to reach may not be the one that's closest as measured by '''hexes''', or closest as measured by steps, from the starting point. Behavior in 1.14 depended on which hex was checked first.
This directory contains both the scenarios used by C++ unit tests and those which are WML unit tests. For the C++ unit tests, it is recommended to reuse the same scenario file as much as possible and just inject WML into it. Injection can be done by adding a config object containing event code and then registering that manually for game_events. WML unit tests are self-contained scenario files to test a specific area of WML. They can be implemented with the GENERIC_UNIT_TEST macro.