Skip to content

Commit

Permalink
fail test for download_files
Browse files Browse the repository at this point in the history
  • Loading branch information
lesomnus committed Jul 29, 2023
1 parent 18ee150 commit 673dd2f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/vcpkg-test/downloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

#include <vcpkg/base/downloads.h>
#include <vcpkg/base/expected.h>
#include <vcpkg/base/files.h>

#include <vcpkg-test/util.h>

using namespace vcpkg;

Expand Down Expand Up @@ -59,6 +62,18 @@ TEST_CASE ("split_uri_view", "[downloads]")
}
}

TEST_CASE ("download_files", "[downloads]")
{
auto const& fs = real_filesystem;
auto const dst = Test::base_temporary_directory() / "download_files";
auto const url = [&](std::string l) -> auto { return std::pair(l, dst); };

std::vector<std::string> headers;

REQUIRE(!download_files(fs, std::vector{url("unknown://localhost:9")}, headers).at(0).has_value());
REQUIRE(!download_files(fs, std::vector{url("http://localhost:9/not-exists")}, headers).at(0).has_value());
}

TEST_CASE ("try_parse_curl_max5_size", "[downloads]")
{
REQUIRE(!try_parse_curl_max5_size("").has_value());
Expand Down

0 comments on commit 673dd2f

Please sign in to comment.