blob: eb1399c5b90011a616c12dd9d652d87f4774c90a [file] [log] [blame]
/*
* Copyright (C) 2016-2018 CESNET, https://photonics.cesnet.cz/
*
* Written by Jan Kundrát <jan.kundrat@cesnet.cz>
*
*/
#pragma once
#include <doctest/doctest.h>
#include <map>
#include <sstream>
#include <trompeloeil.hpp>
namespace doctest {
template <>
struct StringMaker<std::map<std::string, std::string>> {
static String convert(const std::map<std::string, std::string>& map)
{
std::ostringstream os;
os << "{" << std::endl;
for (const auto& [key, value] : map) {
os << " \"" << key << "\": \"" << value << "\"," << std::endl;
}
os << "}";
return os.str().c_str();
}
};
template <>
struct StringMaker<std::map<std::string, int64_t>> {
static String convert(const std::map<std::string, int64_t>& map)
{
std::ostringstream os;
os << "{" << std::endl;
for (const auto& [key, value] : map) {
os << " \"" << key << "\": " << value << "," << std::endl;
}
os << "}";
return os.str().c_str();
}
};
}