aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityParser.cpp
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-17 06:47:37 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-17 06:47:37 +0800
commit905d55e34f85184d0e549b4b2708eb80b933fa8b (patch)
tree55be2a34f5a2ab7f8014c47cc0b259ad40040db6 /test/libsolidity/SolidityParser.cpp
parent559c2106432c8af121cb794d596fd79cf1031973 (diff)
downloaddexon-solidity-905d55e34f85184d0e549b4b2708eb80b933fa8b.tar.gz
dexon-solidity-905d55e34f85184d0e549b4b2708eb80b933fa8b.tar.zst
dexon-solidity-905d55e34f85184d0e549b4b2708eb80b933fa8b.zip
updated tests and much simpler algorithm for parsing errors
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r--test/libsolidity/SolidityParser.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index c5af075a..e6c8a8d8 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -1047,55 +1047,42 @@ BOOST_AUTO_TEST_CASE(using_for)
BOOST_CHECK(successParse(text));
}
-BOOST_AUTO_TEST_CASE(inline_array_declaration_lvalue)
+BOOST_AUTO_TEST_CASE(inline_array_declaration)
{
char const* text = R"(
contract c {
uint[] a;
- function f() returns (uint) {
+ function f() returns (uint, uint) {
a = [1,2,3];
- return (a[3]);
+ return (a[3], [2,3,4][0]);
}
}
)";
BOOST_CHECK(successParse(text));
}
-BOOST_AUTO_TEST_CASE(inline_array_declaration_self)
-{
- char const* text = R"(
- contract c {
- uint[] a;
- function f() returns (uint) {
- return ([1,2,3][0]);
- }
- }
- )";
- BOOST_CHECK(successParse(text));
-}
-BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check_beginning)
+BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check_lvalue)
{
char const* text = R"(
contract c {
uint[] a;
- function f() returns (uint, uint) {
+ function f() returns (uint) {
a = [,2,3];
- return (a[3], [,3,4][0]);
+ return (a[0]);
}
}
)";
BOOST_CHECK(!successParse(text));
}
-BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check_commas)
+BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check_without_lvalue)
{
char const* text = R"(
contract c {
uint[] a;
function f() returns (uint, uint) {
- a = [1, ,3];
- return (a[3], [3, ,4][0]);
+ return ([3, ,4][0]);
}
}
)";