mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
add several var related test cases
This commit is contained in:
parent
157f93898a
commit
d00bad94d7
@ -367,6 +367,40 @@ BOOST_AUTO_TEST_CASE(variable_definition_with_initialization)
|
||||
BOOST_CHECK_NO_THROW(parseText(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(variable_definition_in_function_parameter)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function fun(var a) {}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(variable_definition_in_mapping)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function fun() {
|
||||
mapping(var=>hash) d;
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(variable_definition_in_function_return)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract test {
|
||||
function fun() returns(var d) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(operator_expression)
|
||||
{
|
||||
char const* text = "contract test {\n"
|
||||
|
Loading…
Reference in New Issue
Block a user