mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test for var i = 0;
This commit is contained in:
parent
708d17d13f
commit
73fbaa5a3e
@ -1781,6 +1781,28 @@ BOOST_AUTO_TEST_CASE(exp_warn_literal_base)
|
|||||||
CHECK_SUCCESS(sourceCode);
|
CHECK_SUCCESS(sourceCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(warn_var_from_zero)
|
||||||
|
{
|
||||||
|
char const* sourceCode = R"(
|
||||||
|
contract test {
|
||||||
|
function f() returns (uint) {
|
||||||
|
var i = 1;
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_WARNING(sourceCode, "type uint8, which can only hold");
|
||||||
|
sourceCode = R"(
|
||||||
|
contract test {
|
||||||
|
function f() {
|
||||||
|
for (var i = 0; i < msg.data.length; i++) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
|
CHECK_WARNING(sourceCode, "type uint8, which can only hold");
|
||||||
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(enum_member_access)
|
BOOST_AUTO_TEST_CASE(enum_member_access)
|
||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
Loading…
Reference in New Issue
Block a user