unit-curl.cpp 466 B

1234567891011121314151617181920212223
  1. #include <catch2/catch.hpp>
  2. #include <iostream>
  3. #include <thread>
  4. #include <gul/net/curl.h>
  5. SCENARIO("Test download file")
  6. {
  7. gul::CURL curl;
  8. // for the gcc7 build its complaining
  9. curl.CURL_ADDITIONAL_FLAGS += " --insecure ";
  10. REQUIRE( gul::fs::exists( curl.CURL_PATH));
  11. auto path = curl.cache_file("https://ifconfig.me");
  12. auto path2 = curl.get("https://ifconfig.me");
  13. REQUIRE(path == path2);
  14. REQUIRE(gul::fs::exists(path2));
  15. }