MCPcopy Create free account
hub / github.com/argotorg/solidity / searchErrorMessage

Method searchErrorMessage

test/libsolidity/ErrorCheck.cpp:42–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool 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
58std::string solidity::frontend::test::searchErrors(ErrorList const& _errors, std::vector<std::pair<Error::Type, std::string>> const& _expectations)
59{

Callers

nothing calls this directly

Calls 3

commentMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected