mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Inheritance parser.
This commit is contained in:
parent
02521a164c
commit
ffed2f37cb
@ -495,6 +495,36 @@ BOOST_AUTO_TEST_CASE(multiple_contracts_and_imports)
|
|||||||
BOOST_CHECK_NO_THROW(parseText(text));
|
BOOST_CHECK_NO_THROW(parseText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(contract_inheritance)
|
||||||
|
{
|
||||||
|
char const* text = "contract base {\n"
|
||||||
|
" function fun() {\n"
|
||||||
|
" uint64(2);\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"contract derived is base {\n"
|
||||||
|
" function fun() {\n"
|
||||||
|
" uint64(2);\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_NO_THROW(parseText(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(contract_multiple_inheritance)
|
||||||
|
{
|
||||||
|
char const* text = "contract base {\n"
|
||||||
|
" function fun() {\n"
|
||||||
|
" uint64(2);\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n"
|
||||||
|
"contract derived is base, nonExisting {\n"
|
||||||
|
" function fun() {\n"
|
||||||
|
" uint64(2);\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_NO_THROW(parseText(text));
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user