Include potential explanation when stringifying TestResult Offense

This commit is contained in:
Emma Broman
2021-02-25 12:57:46 +01:00
parent 10eabaa1a6
commit d5671e0321

View File

@@ -91,7 +91,14 @@ std::string to_string(const openspace::documentation::TestResult& value) {
template <>
std::string to_string(const openspace::documentation::TestResult::Offense& value) {
return value.offender + ": " + ghoul::to_string(value.reason);
std::stringstream stream;
stream << value.offender + ": " + ghoul::to_string(value.reason);
if (!value.explanation.empty()) {
stream << fmt::format(" ({})", value.explanation);
}
return stream.str();
}
template <>