Verified Commit 94ba5f12 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Improve error reporting in tests

parent af6d9da7
Loading
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@

#include <fmt/format.h>
#include <fmt/chrono.h>
#include <thread>
#include <chrono>
#include <string_view>
#include <fstream>
@@ -41,6 +40,17 @@
using namespace std::literals;
using namespace std::chrono_literals;

std::ostream&
operator<<(std::ostream& os, const cargo::error_code& ec) {
    os << ec.name();
    return os;
}

CATCH_REGISTER_ENUM(cargo::transfer_state, cargo::transfer_state::pending,
                    cargo::transfer_state::running,
                    cargo::transfer_state::completed,
                    cargo::transfer_state::failed);

struct scoped_file {
    explicit scoped_file(std::filesystem::path filepath)
        : m_filepath(std::move(filepath)) {}