aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-28 17:00:36 +0800
committerchriseth <chris@ethereum.org>2017-06-28 21:02:25 +0800
commit803ab3626b2ea0ed6e9cee2c1b0ac01217390833 (patch)
tree15ceb1d359217b217d68b2494dbf997b16a0cdc2
parentc3e5d6b7ef64f7924754d1b0a1c5577e038e7bf4 (diff)
downloaddexon-solidity-803ab3626b2ea0ed6e9cee2c1b0ac01217390833.tar.gz
dexon-solidity-803ab3626b2ea0ed6e9cee2c1b0ac01217390833.tar.zst
dexon-solidity-803ab3626b2ea0ed6e9cee2c1b0ac01217390833.zip
Verbose error message test failure.
-rw-r--r--test/libsolidity/ErrorCheck.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/ErrorCheck.cpp b/test/libsolidity/ErrorCheck.cpp
index 75555c9b..9b0f9fb7 100644
--- a/test/libsolidity/ErrorCheck.cpp
+++ b/test/libsolidity/ErrorCheck.cpp
@@ -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();
}