15 #define GETTEXT_DOMAIN "wesnoth-test"
17 #include <boost/test/unit_test.hpp>
20 #include <boost/test/data/test_case.hpp>
49 config any_negative {
"x",
"-infinity--1"};
50 config any_positive {
"x",
"1-infinity"};
51 config any_number {
"x",
"-infinity-infinity"};
70 config add_minus_3 {
"add", -3};
78 config add_2_to_4 {
"add",
"2-4"};
79 config sub_2_to_4 {
"sub",
"2-4"};
90 config value_3 {
"value", 3};
97 BOOST_AUTO_TEST_SUITE_END()
A config object defines a single node in a WML file, with access to child nodes.
Utility functions for implementing [filter], [filter_ability], [filter_weapon], etc.
bool unsigned_matches_if_present(const config &filter, const config &cfg, const std::string &attribute)
Restricts filters to only looking for values that are zero or more.
bool int_matches_if_present(const config &filter, const config &cfg, const std::string &attribute, std::optional< int > def=std::nullopt)
bool int_matches_if_present_or_negative(const config &filter, const config &cfg, const std::string &attribute, const std::string &opposite, std::optional< int > def=std::nullopt)
Supports filters using "add" and "sub" attributes, for example a filter add=1 matching a cfg containi...
BOOST_AUTO_TEST_CASE(test_int_positive_filter)
BOOST_AUTO_TEST_SUITE(filesystem)