From 50ad89d369a3ffd90471b2738f2f30491841e197 Mon Sep 17 00:00:00 2001 From: Daniel Kirchner Date: Thu, 15 Mar 2018 16:27:34 +0100 Subject: Only colour error type, not error message in isoltest. --- test/libsolidity/SyntaxTest.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/libsolidity/SyntaxTest.cpp b/test/libsolidity/SyntaxTest.cpp index 70abac48..acfdff29 100644 --- a/test/libsolidity/SyntaxTest.cpp +++ b/test/libsolidity/SyntaxTest.cpp @@ -78,8 +78,11 @@ void SyntaxTest::printExpected(ostream& _stream, string const& _linePrefix, bool FormattedScope(_stream, _formatted, {BOLD, GREEN}) << _linePrefix << "Success" << endl; else for (auto const& expectation: m_expectations) + { FormattedScope(_stream, _formatted, {BOLD, expectation.type == "Warning" ? YELLOW : RED}) << - _linePrefix << expectation.type << ": " << expectation.message << endl; + _linePrefix << expectation.type << ": "; + _stream << expectation.message << endl; + } } void SyntaxTest::printErrorList( @@ -99,17 +102,20 @@ void SyntaxTest::printErrorList( bool isWarning = (error->type() == Error::Type::Warning); if (isWarning && _ignoreWarnings) continue; - FormattedScope scope(_stream, _formatted, {BOLD, isWarning ? YELLOW : RED}); - _stream << _linePrefix; - if (_lineNumbers) { - int line = offsetToLineNumber( - boost::get_error_info(*error)->start - ); - if (line >= 0) - _stream << "(" << line << "): "; + FormattedScope scope(_stream, _formatted, {BOLD, isWarning ? YELLOW : RED}); + _stream << _linePrefix; + if (_lineNumbers) + { + int line = offsetToLineNumber( + boost::get_error_info(*error)->start + ); + if (line >= 0) + _stream << "(" << line << "): "; + } + _stream << error->typeName() << ": "; } - _stream << error->typeName() << ": " << errorMessage(*error) << endl; + _stream << errorMessage(*error) << endl; } } -- cgit v1.2.3