mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
new ForStatement parsing test and small grammar fix
This commit is contained in:
parent
321f88b1be
commit
72e4d08918
@ -374,11 +374,23 @@ BOOST_AUTO_TEST_CASE(while_loop)
|
|||||||
BOOST_CHECK_NO_THROW(parseText(text));
|
BOOST_CHECK_NO_THROW(parseText(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(for_loop)
|
BOOST_AUTO_TEST_CASE(for_loop_vardef_initexpr)
|
||||||
{
|
{
|
||||||
char const* text = "contract test {\n"
|
char const* text = "contract test {\n"
|
||||||
" function fun(uint256 a) {\n"
|
" function fun(uint256 a) {\n"
|
||||||
" for (uint256 i = 0; i < 10; i++;)\n"
|
" for (uint256 i = 0; i < 10; i++)\n"
|
||||||
|
" { uint256 x = i; break; continue; }\n"
|
||||||
|
" }\n"
|
||||||
|
"}\n";
|
||||||
|
BOOST_CHECK_NO_THROW(parseTextExplainError(text));
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(for_loop_simple_initexpr)
|
||||||
|
{
|
||||||
|
char const* text = "contract test {\n"
|
||||||
|
" function fun(uint256 a) {\n"
|
||||||
|
" uint256 i =0;\n"
|
||||||
|
" for (i = 0; i < 10; i++)\n"
|
||||||
" { uint256 x = i; break; continue; }\n"
|
" { uint256 x = i; break; continue; }\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"}\n";
|
"}\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user