From d5671e03217d6e888bb8f2b736dc34f4825b1c9a Mon Sep 17 00:00:00 2001 From: Emma Broman Date: Thu, 25 Feb 2021 12:57:46 +0100 Subject: [PATCH] Include potential explanation when stringifying TestResult Offense --- src/documentation/documentation.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 0d68ba63a2..3c31287910 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -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 <>