mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge branch 'develop' into discoveryEndpoints
This commit is contained in:
commit
5999c04eb5
@ -99,7 +99,7 @@ BOOST_AUTO_TEST_CASE(smoke_test)
|
||||
{
|
||||
char const* text = "contract test {\n"
|
||||
" uint256 stateVariable1;\n"
|
||||
" function fun(uint256 arg1) { var x; uint256 y; }"
|
||||
" function fun(uint256 arg1) { uint256 y; }"
|
||||
"}\n";
|
||||
ETH_TEST_CHECK_NO_THROW(parseTextAndResolveNames(text), "Parsing and Name Resolving Failed");
|
||||
}
|
||||
@ -1623,6 +1623,16 @@ BOOST_AUTO_TEST_CASE(bytes0_array)
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(uninitialized_var)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract C {
|
||||
function f() returns (uint) { var x; return 2; }
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
@ -841,6 +841,15 @@ BOOST_AUTO_TEST_CASE(constant_is_keyword)
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(var_array)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract Foo {
|
||||
function f() { var[] a; }
|
||||
})";
|
||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user