mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add missing name resolver tests
This commit is contained in:
parent
cacc0e4b46
commit
3cd6ac418a
@ -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"(
|
||||
|
Loading…
Reference in New Issue
Block a user