aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityParser.cpp
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2015-12-17 02:55:52 +0800
committerRJ Catalano <catalanor0220@gmail.com>2015-12-17 02:55:52 +0800
commit0ba24a5289eaaf1941c1e84e774f938353b9b94c (patch)
tree8eab9e138065e69a2b5643db9bec61b771b683d2 /test/libsolidity/SolidityParser.cpp
parentcaa6202f62749567870e38c3e4d284984349ca75 (diff)
downloaddexon-solidity-0ba24a5289eaaf1941c1e84e774f938353b9b94c.tar.gz
dexon-solidity-0ba24a5289eaaf1941c1e84e774f938353b9b94c.tar.zst
dexon-solidity-0ba24a5289eaaf1941c1e84e774f938353b9b94c.zip
changed a couple of small nuances, made an attempt at fixing the parsing in the inline arrays case (fails), and added test for inline arrays per Chriseth request
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r--test/libsolidity/SolidityParser.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index d8c1a3e6..b1af54e0 100644
--- a/test/libsolidity/SolidityParser.cpp
+++ b/test/libsolidity/SolidityParser.cpp
@@ -1051,16 +1051,30 @@ BOOST_AUTO_TEST_CASE(inline_array_declaration)
{
char const* text = R"(
contract c {
- uint[] a;
- function f() returns (uint, uint) {
- a = [1,2,3];
- return (a[3], [3,4][0]);
- }
- }
+ uint[] a;
+ function f() returns (uint, uint) {
+ a = [1,2,3];
+ return (a[3], [3,4][0]);
+ }
+ }
)";
BOOST_CHECK(successParse(text));
}
+BOOST_AUTO_TEST_CASE(inline_array_empty_cells_check)
+{
+ 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_SUITE_END()
}