From a201f715a84c3f936e2442e40b4c7f3072d41326 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 7 May 2012 19:12:43 +0100 Subject: [PATCH] Split long failure expressions over multiple lines at the operator --- include/internal/catch_resultinfo.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/internal/catch_resultinfo.hpp b/include/internal/catch_resultinfo.hpp index 9119bd44..d6005268 100644 --- a/include/internal/catch_resultinfo.hpp +++ b/include/internal/catch_resultinfo.hpp @@ -168,7 +168,14 @@ namespace Catch else if( m_op == "matches" ) return m_lhs + " " + m_rhs; else if( m_op != "!" ) - return m_lhs + " " + m_op + " " + m_rhs; + { + if( m_lhs.size() + m_rhs.size() < 30 ) + return m_lhs + " " + m_op + " " + m_rhs; + else if( m_lhs.size() < 70 && m_rhs.size() < 70 ) + return "\n\t" + m_lhs + "\n\t" + m_op + "\n\t" + m_rhs; + else + return "\n" + m_lhs + "\n" + m_op + "\n" + m_rhs + "\n\n"; + } else return "{can't expand - use " + m_macroName + "_FALSE( " + m_expr.substr(1) + " ) instead of " + m_macroName + "( " + m_expr + " ) for better diagnostics}"; }