aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg-test/strings.cpp
diff options
context:
space:
mode:
authorras0219 <robertallenschumacher@gmail.com>2020-06-26 12:16:02 -0700
committerGitHub <noreply@github.com>2020-06-26 12:16:02 -0700
commit91e798afd899f84654f25e3d7f5beb276c6bd5af (patch)
treefcc620a5c63d3523c03c9c30c56188b13276b5a5 /toolsrc/src/vcpkg-test/strings.cpp
parent7ebb42a4d9d8b384bc3128dd571ec9bba8cdd599 (diff)
downloadvcpkg-91e798afd899f84654f25e3d7f5beb276c6bd5af.tar.gz
vcpkg-91e798afd899f84654f25e3d7f5beb276c6bd5af.zip
[vcpkg] Implementation of --x-binarysource=nuget (and friends) (#12058)
* [vcpkg] Initial implementation of --x-binarysource=nuget * [vcpkg] Remove double-double quoting of CMake arguments * [vcpkg] Update nuget.exe to 5.5.1 to support Azure DevOps Artifacts * [vcpkg] Enable batching of NuGet server calls with prefetch(). Add `interactive` binarysource. * [vcpkg] Add `nugetconfig` binary source * [vcpkg] Short circuit querying remote NuGet servers once all refs are found * [vcpkg] Add experimental help for binary caching * [vcpkg] Improved NuGet cache package descriptions and version formatting * [vcpkg] Rename `CmdLineBuilder::build()` to extract() * [vcpkg-help] Ascii-betize help topics * [vcpkg] Add tests for cmdlinebuilder. Improve handling of quotes and slashes. * [vcpkg] Addressing code review comments * [vcpkg] Add tests for vcpkg::reformat_version() * [vcpkg] Added test for vcpkg::generate_nuspec() * [vcpkg] Add tests for vcpkg::XmlSerializer * [vcpkg] Addressed code review comment * [vcpkg] Add test for vcpkg::Strings::find_first_of * [vcpkg] Fix machine-specific paths in test for vcpkg::generate_nuspec() Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
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"));
+}