mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Minor adjustments.
This commit is contained in:
parent
3232561d97
commit
7091b6c8b5
@ -48,7 +48,7 @@ SyntaxTest::SyntaxTest(string const& _filename)
|
|||||||
{
|
{
|
||||||
ifstream file(_filename);
|
ifstream file(_filename);
|
||||||
if (!file)
|
if (!file)
|
||||||
BOOST_THROW_EXCEPTION(runtime_error("cannot open test contract: \"" + _filename + "\""));
|
BOOST_THROW_EXCEPTION(runtime_error("Cannot open test contract: \"" + _filename + "\"."));
|
||||||
file.exceptions(ios::badbit);
|
file.exceptions(ios::badbit);
|
||||||
|
|
||||||
m_source = parseSource(file);
|
m_source = parseSource(file);
|
||||||
@ -60,7 +60,7 @@ bool SyntaxTest::run(ostream& _stream, string const& _indent)
|
|||||||
m_errorList = parseAnalyseAndReturnError(m_source, true, true, true).second;
|
m_errorList = parseAnalyseAndReturnError(m_source, true, true, true).second;
|
||||||
if (!matchesExpectations(m_errorList))
|
if (!matchesExpectations(m_errorList))
|
||||||
{
|
{
|
||||||
std::string nextIndentLevel = _indent.empty() ? "\t" : _indent + _indent;
|
std::string nextIndentLevel = _indent + "\t";
|
||||||
_stream << _indent << "Expected result:" << endl;
|
_stream << _indent << "Expected result:" << endl;
|
||||||
printExpected(_stream, nextIndentLevel);
|
printExpected(_stream, nextIndentLevel);
|
||||||
_stream << _indent << "Obtained result:\n";
|
_stream << _indent << "Obtained result:\n";
|
||||||
@ -99,8 +99,8 @@ bool SyntaxTest::matchesExpectations(ErrorList const& _errorList) const
|
|||||||
else
|
else
|
||||||
for (size_t i = 0; i < _errorList.size(); i++)
|
for (size_t i = 0; i < _errorList.size(); i++)
|
||||||
if (
|
if (
|
||||||
!(_errorList[i]->typeName() == m_expectations[i].type) ||
|
(_errorList[i]->typeName() != m_expectations[i].type) ||
|
||||||
!(errorMessage(*_errorList[i]) == m_expectations[i].message)
|
(errorMessage(*_errorList[i]) != m_expectations[i].message)
|
||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user