mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
new tests
This commit is contained in:
parent
aebce8a1d5
commit
9ab066de8c
@ -1155,7 +1155,6 @@ public:
|
||||
private:
|
||||
std::vector<ASTPointer<Expression>> m_components;
|
||||
bool m_isArray;
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -2743,6 +2743,32 @@ BOOST_AUTO_TEST_CASE(invalid_args_creating_memory_array)
|
||||
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_array_declaration_and_passing)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
uint[] a;
|
||||
function f() returns (uint, uint) {
|
||||
a = [1,2,3];
|
||||
return (a[3], [3,4][0]);
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(success(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(invalid_types_in_inline_array)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract C {
|
||||
function f() {
|
||||
uint[] x = [45, "foo", true];
|
||||
}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user