Adapts tests/ to use AnsiColorized (the generalized/moved version of FormattedScope, which in turn is removed in this PR)

This commit is contained in:
Christian Parpart
2019-02-11 16:00:24 +01:00
parent 49cd55d3a0
commit 53f9be8a23
9 changed files with 43 additions and 109 deletions
+4 -4
View File
@@ -17,7 +17,7 @@
#include <test/libyul/ObjectCompilerTest.h>
#include <test/libsolidity/FormattedScope.h>
#include <libdevcore/AnsiColorized.h>
#include <libsolidity/interface/AssemblyStack.h>
@@ -67,7 +67,7 @@ bool ObjectCompilerTest::run(ostream& _stream, string const& _linePrefix, bool c
AssemblyStack stack(EVMVersion(), AssemblyStack::Language::StrictAssembly);
if (!stack.parseAndAnalyze("source", m_source))
{
FormattedScope(_stream, _formatted, {formatting::BOLD, formatting::RED}) << _linePrefix << "Error parsing source." << endl;
AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::RED}) << _linePrefix << "Error parsing source." << endl;
printErrors(_stream, stack.errors());
return false;
}
@@ -91,9 +91,9 @@ bool ObjectCompilerTest::run(ostream& _stream, string const& _linePrefix, bool c
if (m_expectation != m_obtainedResult)
{
string nextIndentLevel = _linePrefix + " ";
FormattedScope(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << _linePrefix << "Expected result:" << endl;
AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << _linePrefix << "Expected result:" << endl;
printIndented(_stream, m_expectation, nextIndentLevel);
FormattedScope(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << _linePrefix << "Obtained result:" << endl;
AnsiColorized(_stream, _formatted, {formatting::BOLD, formatting::CYAN}) << _linePrefix << "Obtained result:" << endl;
printIndented(_stream, m_obtainedResult, nextIndentLevel);
return false;
}