Skip to content

Commit

Permalink
Tests for warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Feb 16, 2018
1 parent 8e055ee commit 2829264
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/libsolidity/SolidityNameAndTypeResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7803,6 +7803,29 @@ BOOST_AUTO_TEST_CASE(emit_events)
CHECK_SUCCESS_NO_WARNINGS(text);
}

BOOST_AUTO_TEST_CASE(old_style_events_050)
{
char const* text = R"(
contract C {
event e();
function f() public {
e();
}
}
)";
CHECK_WARNING(text, "without \"emit\" prefix");
text = R"(
pragma experimental "v0.5.0";
contract C {
event e();
function f() public {
e();
}
}
)";
CHECK_ERROR(text, TypeError, "have to be prefixed");
}

BOOST_AUTO_TEST_SUITE_END()

}
Expand Down

0 comments on commit 2829264

Please sign in to comment.