mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add ast json converter for ModifierDefinition
This commit is contained in:
@@ -125,6 +125,20 @@ BOOST_AUTO_TEST_CASE(enum_value)
|
||||
BOOST_CHECK_EQUAL(enumDefinition["children"][1]["src"], "25:1:1");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(modifier_definition)
|
||||
{
|
||||
CompilerStack c;
|
||||
c.addSource("a", "contract C { modifier M(uint i) { _ } function F() M(1) {} }");
|
||||
c.parse();
|
||||
map<string, unsigned> sourceIndices;
|
||||
sourceIndices["a"] = 1;
|
||||
Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json();
|
||||
Json::Value modifier = astJson["children"][0]["children"][0];
|
||||
BOOST_CHECK_EQUAL(modifier["name"], "ModifierDefinition");
|
||||
BOOST_CHECK_EQUAL(modifier["attributes"]["name"], "M");
|
||||
BOOST_CHECK_EQUAL(modifier["src"], "13:24:1");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user