aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg-test/strings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/src/vcpkg-test/strings.cpp')
-rw-r--r--toolsrc/src/vcpkg-test/strings.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg-test/strings.cpp b/toolsrc/src/vcpkg-test/strings.cpp
index eb1f5697f..3172b557f 100644
--- a/toolsrc/src/vcpkg-test/strings.cpp
+++ b/toolsrc/src/vcpkg-test/strings.cpp
@@ -41,3 +41,13 @@ TEST_CASE ("split by char", "[strings]")
REQUIRE(split(" hello world ", ' ') == result_t{"hello", "world"});
REQUIRE(split("no delimiters", ',') == result_t{"no delimiters"});
}
+
+TEST_CASE ("find_first_of", "[strings]")
+{
+ using vcpkg::Strings::find_first_of;
+ REQUIRE(find_first_of("abcdefg", "hij") == std::string());
+ REQUIRE(find_first_of("abcdefg", "a") == std::string("abcdefg"));
+ REQUIRE(find_first_of("abcdefg", "g") == std::string("g"));
+ REQUIRE(find_first_of("abcdefg", "bg") == std::string("bcdefg"));
+ REQUIRE(find_first_of("abcdefg", "gb") == std::string("bcdefg"));
+}