Disallow trailing comma in Enum Declaration

This commit is contained in:
Lefteris Karapetsas 2015-02-11 17:23:13 +01:00
parent bb30e9184b
commit 850350e7bc

View File

@ -731,6 +731,20 @@ BOOST_AUTO_TEST_CASE(empty_enum_declaration)
BOOST_CHECK_NO_THROW(parseTextExplainError(text)); BOOST_CHECK_NO_THROW(parseTextExplainError(text));
} }
BOOST_AUTO_TEST_CASE(malformed_enum_declaration)
{
char const* text = R"(
contract c {
enum foo { WARNING,};
function c ()
{
a = foo.CRITICAL;
}
uint256 a;
})";
BOOST_CHECK_THROW(parseText(text), ParserError);
}
BOOST_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
} }