diff options
| author | Billy O'Neal <bion@microsoft.com> | 2020-10-27 20:48:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-27 20:48:14 -0700 |
| commit | a6a1722cfa94caa5db98848679b99377bc5a0112 (patch) | |
| tree | 0f17c63e4a0551866280600e466f21267c8ae1ce /toolsrc/src/vcpkg-test | |
| parent | c34c4189ebbf0795e1f8e2de562c527a854c8db4 (diff) | |
| download | vcpkg-a6a1722cfa94caa5db98848679b99377bc5a0112.tar.gz vcpkg-a6a1722cfa94caa5db98848679b99377bc5a0112.zip | |
[vcpkg, jsonnet, openssl-uwp] Enable use of the system powershell-core if it is present. (#13805)
Diffstat (limited to 'toolsrc/src/vcpkg-test')
| -rw-r--r-- | toolsrc/src/vcpkg-test/files.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg-test/files.cpp b/toolsrc/src/vcpkg-test/files.cpp index 429a4ba15..94cf7e1dd 100644 --- a/toolsrc/src/vcpkg-test/files.cpp +++ b/toolsrc/src/vcpkg-test/files.cpp @@ -250,6 +250,21 @@ TEST_CASE ("win32_fix_path_case", "[files]") } #endif // _WIN32 +TEST_CASE ("add_filename", "[files]") +{ + using vcpkg::Files::add_filename; + using vcpkg::Files::preferred_separator; + + CHECK(add_filename("a/b", "c") == std::string("a/b") + preferred_separator + "c"); + CHECK(add_filename("a/b/", "c") == "a/b/c"); + CHECK(add_filename("a/b\\", "c") == "a/b\\c"); + CHECK(add_filename("", "c") == "c"); + + // note that we don't special case slashes in the second argument; the caller shouldn't do that + CHECK(add_filename("a/b/", "\\c") == "a/b/\\c"); + CHECK(add_filename("a/b\\", "/c") == "a/b\\/c"); +} + #if defined(CATCH_CONFIG_ENABLE_BENCHMARKING) TEST_CASE ("remove all -- benchmarks", "[files][!benchmark]") { |
