aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-25 08:28:47 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-25 08:28:47 +0800
commit7600a814fac44402915af827d70ba832d45b564a (patch)
tree0c00dd02dd90b5735c7b4034d8419a0276159573
parentaf2d2499c1ccd431f5ac9455c2cbb63d3891f9b0 (diff)
downloaddexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar.gz
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar.bz2
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar.lz
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar.xz
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.tar.zst
dexon-solidity-7600a814fac44402915af827d70ba832d45b564a.zip
Enable the analyzer for Julia tests
-rw-r--r--test/libjulia/Parser.cpp14
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)