diff options
author | chriseth <chris@ethereum.org> | 2017-11-24 01:52:04 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-11-24 01:52:04 +0800 |
commit | 1d91b65b726d4757b866124d75834f28a9bc9eb9 (patch) | |
tree | 049d990547390147c3a135ac1c38d75c88024c32 /test | |
parent | 9232cd2621113dac43829b7f0dd37f791526f0b4 (diff) | |
download | dexon-solidity-1d91b65b726d4757b866124d75834f28a9bc9eb9.tar.gz dexon-solidity-1d91b65b726d4757b866124d75834f28a9bc9eb9.tar.zst dexon-solidity-1d91b65b726d4757b866124d75834f28a9bc9eb9.zip |
Force condition to be bool in iulia mode.
Diffstat (limited to 'test')
-rw-r--r-- | test/libjulia/Parser.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp index 473a1d2c..9aa325a4 100644 --- a/test/libjulia/Parser.cpp +++ b/test/libjulia/Parser.cpp @@ -271,15 +271,17 @@ BOOST_AUTO_TEST_CASE(multiple_assignment) BOOST_AUTO_TEST_CASE(if_statement) { - BOOST_CHECK(successParse("{ if 42:u256 {} }")); - BOOST_CHECK(successParse("{ if 42:u256 { let x:u256 := 3:u256 } }")); - BOOST_CHECK(successParse("{ function f() -> x:u256 {} if f() { let b:u256 := f() } }")); + BOOST_CHECK(successParse("{ if true:bool {} }")); + BOOST_CHECK(successParse("{ if false:bool { let x:u256 := 3:u256 } }")); + BOOST_CHECK(successParse("{ function f() -> x:bool {} if f() { let b:bool := f() } }")); } BOOST_AUTO_TEST_CASE(if_statement_invalid) { CHECK_ERROR("{ if let x:u256 {} }", ParserError, "Literal or identifier expected."); - CHECK_ERROR("{ if 32:u256 let x:u256 := 3:u256 }", ParserError, "Expected token LBrace"); + CHECK_ERROR("{ if true:bool let x:u256 := 3:u256 }", ParserError, "Expected token LBrace"); + // TODO change this to an error once we check types. + BOOST_CHECK(successParse("{ if 42:u256 { } }")); } BOOST_AUTO_TEST_SUITE_END() |