Skip to content

Commit

Permalink
Merge pull request ethereum#3133 from federicobond/add-missing-tests
Browse files Browse the repository at this point in the history
Add missing name resolver tests
  • Loading branch information
chriseth authored Oct 27, 2017
2 parents 59d4dfb + 3cd6ac4 commit 1e085f8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/libsolidity/SolidityNameAndTypeResolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4036,6 +4036,35 @@ BOOST_AUTO_TEST_CASE(varM_disqualified_as_keyword)
BOOST_CHECK(!success(text));
}

BOOST_AUTO_TEST_CASE(modifier_is_not_a_valid_typename)
{
char const* text = R"(
contract test {
modifier mod() { _; }
function f() public {
mod g;
}
}
)";
CHECK_ERROR(text, TypeError, "Name has to refer to a struct, enum or contract.");
}

BOOST_AUTO_TEST_CASE(function_is_not_a_valid_typename)
{
char const* text = R"(
contract test {
function foo() public {
}
function f() public {
foo g;
}
}
)";
CHECK_ERROR(text, TypeError, "Name has to refer to a struct, enum or contract.");
}

BOOST_AUTO_TEST_CASE(long_uint_variable_fails)
{
char const* text = R"(
Expand Down

0 comments on commit 1e085f8

Please sign in to comment.