diff options
author | Alex Sinyagin <sinyagin.alexander@gmail.com> | 2016-08-17 23:20:17 +0800 |
---|---|---|
committer | Alex Sinyagin <sinyagin.alexander@gmail.com> | 2016-08-18 20:30:00 +0800 |
commit | 406f3a4b5d3827f09e5f1035b79627dcc0e907d9 (patch) | |
tree | 0a77440fc171dcfb69fb7de94bef08f019bf1af3 /test | |
parent | e9c894c9f80b4a30560c1b88614cbd767abd908b (diff) | |
download | dexon-solidity-406f3a4b5d3827f09e5f1035b79627dcc0e907d9.tar.gz dexon-solidity-406f3a4b5d3827f09e5f1035b79627dcc0e907d9.tar.zst dexon-solidity-406f3a4b5d3827f09e5f1035b79627dcc0e907d9.zip |
Add ast json converter for PlaceholderStatement
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/ASTJSON.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp index 1a213b23..53222f65 100644 --- a/test/libsolidity/ASTJSON.cpp +++ b/test/libsolidity/ASTJSON.cpp @@ -182,6 +182,19 @@ BOOST_AUTO_TEST_CASE(array_type_name) BOOST_CHECK_EQUAL(array["src"], "13:6:1"); } +BOOST_AUTO_TEST_CASE(placeholder_statement) +{ + CompilerStack c; + c.addSource("a", "contract C { modifier M { _ } }"); + c.parse(); + map<string, unsigned> sourceIndices; + sourceIndices["a"] = 1; + Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json(); + Json::Value placeholder = astJson["children"][0]["children"][0]["children"][1]["children"][0]; + BOOST_CHECK_EQUAL(placeholder["name"], "Placeholder"); + BOOST_CHECK_EQUAL(placeholder["src"], "26:1:1"); +} + BOOST_AUTO_TEST_SUITE_END() } |