diff options
author | chriseth <chris@ethereum.org> | 2017-05-26 17:15:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 17:15:05 +0800 |
commit | 7126aadab1ecb1eea004c45a7348af2a4d919b36 (patch) | |
tree | 7b37fd11d97f96b08af55137bf37234aaa3913e0 | |
parent | e1519f4f271ea1e2a1aedb74df8b1cfd68d8c5a0 (diff) | |
parent | 7600a814fac44402915af827d70ba832d45b564a (diff) | |
download | dexon-solidity-7126aadab1ecb1eea004c45a7348af2a4d919b36.tar.gz dexon-solidity-7126aadab1ecb1eea004c45a7348af2a4d919b36.tar.zst dexon-solidity-7126aadab1ecb1eea004c45a7348af2a4d919b36.zip |
Merge pull request #2310 from ethereum/julia-test-analyzer
Enable the analyzer for Julia tests
-rw-r--r-- | test/libjulia/Parser.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp index 3931ceb8..31dbd278 100644 --- a/test/libjulia/Parser.cpp +++ b/test/libjulia/Parser.cpp @@ -52,7 +52,10 @@ bool parse(string const& _source, ErrorList& errors) auto scanner = make_shared<Scanner>(CharStream(_source)); auto parserResult = assembly::Parser(errors, true).parse(scanner); if (parserResult) - return true; + { + assembly::AsmAnalysisInfo analysisInfo; + return (assembly::AsmAnalyzer(analysisInfo, errors)).analyze(*parserResult); + } } catch (FatalError const&) { @@ -131,14 +134,9 @@ BOOST_AUTO_TEST_CASE(assignment) BOOST_CHECK(successParse("{ let x:u256 := 2:u256 let y:u256 := x }")); } -BOOST_AUTO_TEST_CASE(function_call) -{ - BOOST_CHECK(successParse("{ fun() fun(fun()) }")); -} - BOOST_AUTO_TEST_CASE(vardecl_complex) { - BOOST_CHECK(successParse("{ let y:u256 := 2:u256 let x:u256 := add(7:u256, mul(6:u256, y)) }")); + BOOST_CHECK(successParse("{ function add(a:u256, b:u256) -> c:u256 {} let y:u256 := 2:u256 let x:u256 := add(7:u256, add(6:u256, y)) }")); } BOOST_AUTO_TEST_CASE(blocks) @@ -158,7 +156,7 @@ BOOST_AUTO_TEST_CASE(function_definitions_multiple_args) BOOST_AUTO_TEST_CASE(function_calls) { - BOOST_CHECK(successParse("{ function f(a:u256) -> b:u256 {} function g(a:u256, b:u256, c:u256) {} function x() { g(1:u256, 2:u256, f(mul(2:u256, 3:u256))) x() } }")); + BOOST_CHECK(successParse("{ function f(a:u256) -> b:u256 {} function g(a:u256, b:u256, c:u256) {} function x() { g(1:u256, 2:u256, f(3:u256)) x() } }")); } BOOST_AUTO_TEST_CASE(tuple_assignment) |