aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAlex Sinyagin <sinyagin.alexander@gmail.com>2016-08-17 23:09:21 +0800
committerAlex Sinyagin <sinyagin.alexander@gmail.com>2016-08-18 20:30:00 +0800
commite9c894c9f80b4a30560c1b88614cbd767abd908b (patch)
tree8fbe8b5a99969982431f0eaf3dabe1046758c402 /test
parentbdc2436ae38b9028311736ef52f36e3525227eb6 (diff)
downloaddexon-solidity-e9c894c9f80b4a30560c1b88614cbd767abd908b.tar.gz
dexon-solidity-e9c894c9f80b4a30560c1b88614cbd767abd908b.tar.zst
dexon-solidity-e9c894c9f80b4a30560c1b88614cbd767abd908b.zip
Add ast json converter for ArrayTypeName
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/ASTJSON.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp
index 69c42814..1a213b23 100644
--- a/test/libsolidity/ASTJSON.cpp
+++ b/test/libsolidity/ASTJSON.cpp
@@ -169,6 +169,19 @@ BOOST_AUTO_TEST_CASE(event_definition)
BOOST_CHECK_EQUAL(event["src"], "13:10:1");
}
+BOOST_AUTO_TEST_CASE(array_type_name)
+{
+ CompilerStack c;
+ c.addSource("a", "contract C { uint[] i; }");
+ c.parse();
+ map<string, unsigned> sourceIndices;
+ sourceIndices["a"] = 1;
+ Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json();
+ Json::Value array = astJson["children"][0]["children"][0]["children"][0];
+ BOOST_CHECK_EQUAL(array["name"], "ArrayTypeName");
+ BOOST_CHECK_EQUAL(array["src"], "13:6:1");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}