From 673dd2f70bccfe06cf0e3c8e6121788a87b0c80a Mon Sep 17 00:00:00 2001 From: Seunghyun Hwang Date: Sat, 29 Jul 2023 18:52:07 +0900 Subject: [PATCH] fail test for download_files --- src/vcpkg-test/downloads.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/vcpkg-test/downloads.cpp b/src/vcpkg-test/downloads.cpp index 02c9be3f69..30983dfe8c 100644 --- a/src/vcpkg-test/downloads.cpp +++ b/src/vcpkg-test/downloads.cpp @@ -2,6 +2,9 @@ #include #include +#include + +#include using namespace vcpkg; @@ -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 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());