This adds an additional `test_result` attribute to [endlevel], intended for use with the automated unit tests. This allows for the unit tests to differentiate a pass/fail result separately from scenario victory or defeat, which allows for more accurately determining the outcome of a test as well as addresses the potential, for example, for a scenario to be expect to pass because of the {SUCCEED} macro but instead passes because the scenario ended as a victory through some other method.
Additional unit tests which were the original motivation for this change are also added as part of this. They test, as much as possible, that events are executed at all, and are then also executed in the expected order.
* Units - Dunefolk - first draft at Falconer branch of skirmisher
* Dunefolk - revision to Falconer line
* Units - dunefolk - some progress on falconer standing animation
* Units - dunefolk - attack animations for falconer
* Units - dunefolk - defense and melee (partial) attack anims
* units - dunefolk - WIP lvl3 falconer
* units - dunefolk - revise falconer
* units - dunefolk - animation work on Falconer line
* units - dunefolk - falconer ability diversion revised to affect enemy chance-to-hit. Animation filter/trigger not yet resolved
* units/abilities - dunefolk falconer diversion ability-related animations mechanism
* units - dunefolk - sky_hunter animation frames
* dunefolk/abilities - fix diversion animations to work on die event
* abilities - schema validation induced correction
* abilities - diversion animations - attempt to fix case of undo movement
* units - dunefolk - finish some cosmetic issues for Falconer line
* units - dunefolk - wmlindent
* use on_undo over select in diversionability
undoing can only change the 'diversion' state if the original action also did,
so there is no reason to check it in all 'select' events.
* fixup
* minor clean-up
Co-authored-by: gfgtdf <daniel.gfgtdf@gmail.com>
this code handles wesnoth.persistent_tags which is used by all addons. The previous behviour would mean that an addon that uses wesnoth.persistent_tags wrongly would also break other code that uses wesnoth.persistent_tags like the [item] implementation.
One of the cases fails due to something in find_vacant_tile - perhaps someone else can figure out how to fix this?
If nothing else, setting check_passability=no in the [move_unit] should do it, but I'd prefer not to have to do that...
Also extend the unit test to at least check the end result of comma-separated
values, as there was previously nothing testing the effect of providing more
than one value.
- Move format_conjunct_list and format_disjunct_list
- Move wesnoth.format (renamed to vformat so as not to conflict with string.format); it's also available as tstr:format()
- Add stringx.trim
- The convenience wrappers of stringx.split now set the remove_empty and strip_space flags
The built-in string module is set as the metatable index for the stringx module, and the stringx module is set as the metatable index for strings, meaning all string and stringx methods are available through (''):method_name.
This also enables direct indexing of strings to get individual characters (ie ('str')[1] and the like), which package.lua already assumed even though it didn't work. Negative indices are supported to, and index from the end of the srring.
New functions:
- stringx.split
- stringx.parenthetical_split
- stringx.map_split
- stringx.escaped_split
- stringx.quoted_split
- stringx.anim_split
- stringx.join
- stringx.join_map
- New functions: wml.find_child, wml.attribute_count, wml.equal, wml.valid
- When converting a Lua table to WML, the engine will no longer accept invalid attributes
- Use of wml.tovconfig in plugin or map generation scripts is deprecated (it already doesn't quite work properly in those contexts but still could've been used as a way to test a table's validity as WML)