summaryrefslogtreecommitdiff
path: root/src/utils/stringutils_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/stringutils_unittest.cc')
-rw-r--r--src/utils/stringutils_unittest.cc13
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();