aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityParser.cpp
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-17 06:01:45 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-17 06:01:45 +0800
commit559c2106432c8af121cb794d596fd79cf1031973 (patch)
tree8fffda3a6ffc1e5ff789aac0ce2ac0f1c6c7de38 /test/libsolidity/SolidityParser.cpp
parent734318ed0408a59bd8efc3fc51978a41df110d70 (diff)
parentfe04d7f7f7686ae8fa406880b3c3069e60ee1c20 (diff)
downloaddexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar.gz
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar.bz2
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar.lz
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar.xz
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.tar.zst
dexon-solidity-559c2106432c8af121cb794d596fd79cf1031973.zip
Merge branch 'inlineArrays' into develop
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r--test/libsolidity/SolidityParser.cpp55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index fd9076c3..c5af075a 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -1047,6 +1047,61 @@ BOOST_AUTO_TEST_CASE(using_for)
BOOST_CHECK(successParse(text));
}
+BOOST_AUTO_TEST_CASE(inline_array_declaration_lvalue)
+{
+ char const* text = R"(
+ contract c {
+ uint[] a;
+ function f() returns (uint) {
+ a = [1,2,3];
+ return (a[3]);
+ }
+ }
+ )";
+ 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)
+{
+ 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_CASE(inline_array_empty_cells_check_commas)
+{
+ char const* text = R"(
+ contract c {
+ uint[] a;
+ function f() returns (uint, uint) {
+ a = [1, ,3];
+ return (a[3], [3, ,4][0]);
+ }
+ }
+ )";
+ BOOST_CHECK(!successParse(text));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}