From 66a6e5186ffd12679b8c3ca6980e11efd74d2f00 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Tue, 21 Feb 2023 15:15:59 +0100 Subject: test: Add tests for reading in Git proxy settings --- .../git_operations/git_config_run.test.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'test/other_tools/git_operations/git_config_run.test.cpp') diff --git a/test/other_tools/git_operations/git_config_run.test.cpp b/test/other_tools/git_operations/git_config_run.test.cpp index 9a9af9b9..8ffd744a 100644 --- a/test/other_tools/git_operations/git_config_run.test.cpp +++ b/test/other_tools/git_operations/git_config_run.test.cpp @@ -93,8 +93,24 @@ auto main(int argc, char* argv[]) -> int { } } else if (test_type == "proxy") { - Logger::Log(LogLevel::Error, "Proxy tests not yet implemented"); - return 1; + auto proxy_info = + GitConfigSettings::GetProxySettings(cfg, test_url, logger); + if (not proxy_info) { + Logger::Log(LogLevel::Error, "Missing proxy_info"); + return 1; + } + // check expected result + auto expected_result = + (argc >= 4) ? std::make_optional(args[3]) + : std::nullopt; + auto actual_result = proxy_info.value(); + if (actual_result != expected_result) { + Logger::Log(LogLevel::Error, + "Expected test result {}, but obtained {}", + expected_result ? *expected_result : "nullopt", + actual_result ? *actual_result : "nullopt"); + return 1; + } } else { Logger::Log(LogLevel::Error, -- cgit v1.2.3