diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-20 17:29:53 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 02:38:00 +0800 |
commit | 74373ecc7ab538de03c69a7a26edb345be661355 (patch) | |
tree | b3f44ad47f31ef5bde284e68e87a87cce6f146f0 | |
parent | c29da75f9617cfd9836e355a04cbb5b86328273f (diff) | |
download | dexon-solidity-74373ecc7ab538de03c69a7a26edb345be661355.tar.gz dexon-solidity-74373ecc7ab538de03c69a7a26edb345be661355.tar.zst dexon-solidity-74373ecc7ab538de03c69a7a26edb345be661355.zip |
Add test for legacyAST
-rw-r--r-- | test/libsolidity/StandardCompiler.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/libsolidity/StandardCompiler.cpp b/test/libsolidity/StandardCompiler.cpp index 553f1d1f..9b53e841 100644 --- a/test/libsolidity/StandardCompiler.cpp +++ b/test/libsolidity/StandardCompiler.cpp @@ -255,7 +255,12 @@ BOOST_AUTO_TEST_CASE(basic_compilation) "{\"creation\":{\"codeDepositCost\":\"10200\",\"executionCost\":\"62\",\"totalCost\":\"10262\"}}"); BOOST_CHECK(contract["metadata"].isString()); BOOST_CHECK(isValidMetadata(contract["metadata"].asString())); - /// @TODO check "sources" (ast) + BOOST_CHECK(result["sources"].isObject()); + BOOST_CHECK(result["sources"]["fileA"].isObject()); + BOOST_CHECK(result["sources"]["fileA"]["legacyAST"].isObject()); + BOOST_CHECK(dev::jsonCompactPrint(result["sources"]["fileA"]["legacyAST"]) == + "{\"children\":[{\"attributes\":{\"fullyImplemented\":true,\"isLibrary\":false,\"linearizedBaseContracts\":[1]," + "\"name\":\"A\"},\"children\":[],\"id\":1,\"name\":\"ContractDefinition\",\"src\":\"0:14:0\"}],\"name\":\"SourceUnit\"}"); } BOOST_AUTO_TEST_SUITE_END() |