Wrap expr results if they contain newlines

This commit is contained in:
Phil Nash 2013-03-25 09:24:13 +00:00
parent 2927c240a1
commit c563f6b1be

View File

@ -82,7 +82,9 @@ namespace Catch {
else if( m_exprComponents.op == "matches" ) else if( m_exprComponents.op == "matches" )
return m_exprComponents.lhs + " " + m_exprComponents.rhs; return m_exprComponents.lhs + " " + m_exprComponents.rhs;
else if( m_exprComponents.op != "!" ) { else if( m_exprComponents.op != "!" ) {
if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 ) if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 &&
m_exprComponents.lhs.find("\n") == std::string::npos &&
m_exprComponents.rhs.find("\n") == std::string::npos )
return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs; return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs;
else else
return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs; return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs;