aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/ASTJSON.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-11-15 06:37:19 +0800
committerchriseth <c@ethdev.com>2016-11-16 21:37:19 +0800
commite1fec9b2877492658b079d3278a702310213fe2a (patch)
tree91bc93eb1efc39e84a5af7cf6d7789cbad175447 /test/libsolidity/ASTJSON.cpp
parent830f14c3a3c7bc991ad34c1b0299a31368853d97 (diff)
downloaddexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar.gz
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar.bz2
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar.lz
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar.xz
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.tar.zst
dexon-solidity-e1fec9b2877492658b079d3278a702310213fe2a.zip
JSON tests.
Diffstat (limited to 'test/libsolidity/ASTJSON.cpp')
-rw-r--r--test/libsolidity/ASTJSON.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp
index 6c062ee8..0180c4ac 100644
--- a/test/libsolidity/ASTJSON.cpp
+++ b/test/libsolidity/ASTJSON.cpp
@@ -197,6 +197,20 @@ BOOST_AUTO_TEST_CASE(non_utf8)
BOOST_CHECK(literal["attributes"]["type"].asString().find("invalid") != string::npos);
}
+BOOST_AUTO_TEST_CASE(function_type)
+{
+ CompilerStack c;
+ c.addSource("a", "contract C { function f(function() external payable constant returns (uint) x) {} }");
+ c.parse();
+ map<string, unsigned> sourceIndices;
+ sourceIndices["a"] = 1;
+ Json::Value astJson = ASTJsonConverter(c.ast("a"), sourceIndices).json();
+ Json::Value event = astJson["children"][0]["children"][0];
+ BOOST_CHECK_EQUAL(event["name"], "EventDefinition");
+ BOOST_CHECK_EQUAL(event["attributes"]["name"], "E");
+ BOOST_CHECK_EQUAL(event["src"], "13:10:1");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}