aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/ASTJSON.cpp
diff options
context:
space:
mode:
authorErik Kundt <bitshift@posteo.org>2018-04-09 19:35:03 +0800
committerDaniel Kirchner <daniel@ekpyron.org>2018-04-13 03:14:50 +0800
commit824008340ae3ba6c1ad89d05942db3839d1fa4a5 (patch)
treed48411ad93637a002c345e518672c0e707c87656 /test/libsolidity/ASTJSON.cpp
parent8935c0dd2f47a20ed7cc2d1b6e11fa7cdd978b79 (diff)
downloaddexon-solidity-824008340ae3ba6c1ad89d05942db3839d1fa4a5.tar.gz
dexon-solidity-824008340ae3ba6c1ad89d05942db3839d1fa4a5.tar.zst
dexon-solidity-824008340ae3ba6c1ad89d05942db3839d1fa4a5.zip
Adds type expectations to legacy tests.
Diffstat (limited to 'test/libsolidity/ASTJSON.cpp')
-rw-r--r--test/libsolidity/ASTJSON.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/libsolidity/ASTJSON.cpp b/test/libsolidity/ASTJSON.cpp
index b585d13f..e3467ba2 100644
--- a/test/libsolidity/ASTJSON.cpp
+++ b/test/libsolidity/ASTJSON.cpp
@@ -66,6 +66,7 @@ BOOST_AUTO_TEST_CASE(source_location)
BOOST_CHECK_EQUAL(astJson["children"][0]["name"], "ContractDefinition");
BOOST_CHECK_EQUAL(astJson["children"][0]["children"][0]["name"], "FunctionDefinition");
BOOST_CHECK_EQUAL(astJson["children"][0]["children"][0]["src"], "13:32:1");
+
}
BOOST_AUTO_TEST_CASE(inheritance_specifier)
@@ -176,6 +177,9 @@ BOOST_AUTO_TEST_CASE(array_type_name)
map<string, unsigned> sourceIndices;
sourceIndices["a"] = 1;
Json::Value astJson = ASTJsonConverter(true, sourceIndices).toJson(c.ast("a"));
+ Json::Value arrayDecl = astJson["children"][0]["children"][0]["attributes"];
+ BOOST_CHECK_EQUAL(arrayDecl["storageLocation"], "default");
+ BOOST_CHECK_EQUAL(arrayDecl["type"], "uint256[]");
Json::Value array = astJson["children"][0]["children"][0]["children"][0];
BOOST_CHECK_EQUAL(array["name"], "ArrayTypeName");
BOOST_CHECK_EQUAL(array["src"], "13:6:1");
@@ -234,6 +238,9 @@ BOOST_AUTO_TEST_CASE(non_utf8)
map<string, unsigned> sourceIndices;
sourceIndices["a"] = 1;
Json::Value astJson = ASTJsonConverter(true, sourceIndices).toJson(c.ast("a"));
+ Json::Value varDecl = astJson["children"][0]["children"][0]["children"][2]["children"][0]["children"][0];
+ BOOST_CHECK_EQUAL(varDecl["attributes"]["type"], "string");
+ BOOST_CHECK_EQUAL(varDecl["attributes"]["typeName"], Json::nullValue);
Json::Value literal = astJson["children"][0]["children"][0]["children"][2]["children"][0]["children"][1];
BOOST_CHECK_EQUAL(literal["name"], "Literal");
BOOST_CHECK_EQUAL(literal["attributes"]["hexvalue"], "ff");