Tests for revert with reason string.

This commit is contained in:
chriseth
2018-04-12 13:09:37 +02:00
parent 012ab37fe3
commit a06249c984
2 changed files with 53 additions and 1 deletions
@@ -5987,7 +5987,22 @@ BOOST_AUTO_TEST_CASE(bare_revert)
}
}
)";
CHECK_WARNING(text, "Statement has no effect.");
CHECK_ERROR(text, TypeError, "No matching declaration found");
}
BOOST_AUTO_TEST_CASE(revert_with_reason)
{
char const* text = R"(
contract C {
function f(uint x) pure public {
if (x > 7)
revert("abc");
else
revert();
}
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
}
BOOST_AUTO_TEST_CASE(bare_others)