From 74373ecc7ab538de03c69a7a26edb345be661355 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 20 Apr 2017 10:29:53 +0100 Subject: Add test for legacyAST --- test/libsolidity/StandardCompiler.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/libsolidity') 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() -- cgit