mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Verbose error message test failure.
This commit is contained in:
parent
c3e5d6b7ef
commit
803ab3626b
@ -29,6 +29,15 @@ using namespace std;
|
||||
bool dev::solidity::searchErrorMessage(Error const& _err, std::string const& _substr)
|
||||
{
|
||||
if (string const* errorMessage = boost::get_error_info<dev::errinfo_comment>(_err))
|
||||
return errorMessage->find(_substr) != std::string::npos;
|
||||
{
|
||||
if (errorMessage->find(_substr) == std::string::npos)
|
||||
{
|
||||
cout << "Expected message \"" << _substr << "\" but found" << *errorMessage << endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
cout << "Expected error message but found none." << endl;
|
||||
return _substr.empty();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user