diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-10 16:36:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-10 16:36:04 +0300 |
commit | 5a15b718a475f8c2809521ea3166de379bf85b36 (patch) | |
tree | 9b50a62cf5192469dc23448aace0d7ba7996ccf0 /src/utils/stringutils_unittest.cc | |
parent | e19faa6874b92a949703e37e07e912c693545496 (diff) | |
download | manaverse-5a15b718a475f8c2809521ea3166de379bf85b36.tar.gz manaverse-5a15b718a475f8c2809521ea3166de379bf85b36.tar.bz2 manaverse-5a15b718a475f8c2809521ea3166de379bf85b36.tar.xz manaverse-5a15b718a475f8c2809521ea3166de379bf85b36.zip |
In parameters parsing function add support for multiply separators.
Diffstat (limited to 'src/utils/stringutils_unittest.cc')
-rw-r--r-- | src/utils/stringutils_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc index f6586558c..b921cf509 100644 --- a/src/utils/stringutils_unittest.cc +++ b/src/utils/stringutils_unittest.cc @@ -593,6 +593,19 @@ TEST_CASE("stringuntils isDigit") REQUIRE_FALSE(isDigit("12-34")); } +TEST_CASE("stringuntils findAny") +{ + std::string str; + + REQUIRE(findAny("test line", ",", 0) == std::string::npos); + REQUIRE(findAny("test line", " ", 0) == 4U); + REQUIRE(findAny("test, line", ", ", 0) == 4U); + REQUIRE(findAny("test ,line", ", ", 0) == 4U); + REQUIRE(findAny("test, line", " ,", 2) == 4U); + REQUIRE(findAny("test ,line", " ,", 3) == 4U); + REQUIRE(findAny("\"one\",,two, tree", ",", 5) == 5U); +} + TEST_CASE("stringuntils replaceItemLinks") { ItemDB::NamedItemInfos &infos = ItemDB::getNamedItemInfosTest(); |