| 40 | } |
| 41 | |
| 42 | bool solidity::frontend::test::searchErrorMessage(Error const& _err, std::string const& _substr) |
| 43 | { |
| 44 | if (std::string const* errorMessage = _err.comment()) |
| 45 | { |
| 46 | if (errorMessage->find(_substr) == std::string::npos) |
| 47 | { |
| 48 | std::cout << "Expected message \"" << _substr << "\" but found \"" << *errorMessage << "\".\n"; |
| 49 | return false; |
| 50 | } |
| 51 | return true; |
| 52 | } |
| 53 | else |
| 54 | std::cout << "Expected error message but found none." << std::endl; |
| 55 | return _substr.empty(); |
| 56 | } |
| 57 | |
| 58 | std::string solidity::frontend::test::searchErrors(ErrorList const& _errors, std::vector<std::pair<Error::Type, std::string>> const& _expectations) |
| 59 | { |