mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
changed a couple of small nuances, made an attempt at fixing the parsing in the inline arrays case (fails), and added test for inline arrays per Chriseth request
This commit is contained in:
@@ -1051,16 +1051,30 @@ BOOST_AUTO_TEST_CASE(inline_array_declaration)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract c {
|
||||
uint[] a;
|
||||
function f() returns (uint, uint) {
|
||||
a = [1,2,3];
|
||||
return (a[3], [3,4][0]);
|
||||
}
|
||||
}
|
||||
uint[] a;
|
||||
function f() returns (uint, uint) {
|
||||
a = [1,2,3];
|
||||
return (a[3], [3,4][0]);
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(successParse(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract c {
|
||||
uint[] a;
|
||||
function f() returns (uint, uint) {
|
||||
a = [,2,3];
|
||||
return (a[3], [3,4][0]);
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(!successParse(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user