diff options
author | chriseth <chris@ethereum.org> | 2017-08-21 22:34:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-21 22:34:59 +0800 |
commit | 01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa (patch) | |
tree | 577b2d76fbc0388954f69b750a50796f2ba17b63 /test | |
parent | fe25bcf350bfb65ddb69bc5e7d3f65dfa6d23fa7 (diff) | |
parent | 1be713acc7abc2f1d21d962e840b1e369d1d8ff6 (diff) | |
download | dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar.gz dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar.bz2 dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar.lz dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar.xz dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.tar.zst dexon-solidity-01b4bba0ed7544ed6f54f97dd5d5a3b0d397fbfa.zip |
Merge branch 'develop' into library-constructor
Diffstat (limited to 'test')
-rw-r--r-- | test/libjulia/Parser.cpp | 8 | ||||
-rw-r--r-- | test/libsolidity/InlineAssembly.cpp | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/libjulia/Parser.cpp b/test/libjulia/Parser.cpp index dd6f3d94..e1bf5a3a 100644 --- a/test/libjulia/Parser.cpp +++ b/test/libjulia/Parser.cpp @@ -214,6 +214,14 @@ BOOST_AUTO_TEST_CASE(invalid_types) CHECK_ERROR("{ function f(a:invalid) {} }", TypeError, "\"invalid\" is not a valid type (user defined types are not yet supported)."); } +BOOST_AUTO_TEST_CASE(number_literals) +{ + BOOST_CHECK(successParse("{ let x:u256 := 1:u256 }")); + CHECK_ERROR("{ let x:u256 := .1:u256 }", ParserError, "Invalid number literal."); + CHECK_ERROR("{ let x:u256 := 1e5:u256 }", ParserError, "Invalid number literal."); + CHECK_ERROR("{ let x:u256 := 67.235:u256 }", ParserError, "Invalid number literal."); +} + BOOST_AUTO_TEST_CASE(builtin_types) { BOOST_CHECK(successParse("{ let x:bool := true:bool }")); diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index 4bf4eb48..8e1c304a 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -339,6 +339,14 @@ BOOST_AUTO_TEST_CASE(blocks) BOOST_CHECK(successParse("{ let x := 7 { let y := 3 } { let z := 2 } }")); } +BOOST_AUTO_TEST_CASE(number_literals) +{ + BOOST_CHECK(successParse("{ let x := 1 }")); + CHECK_PARSE_ERROR("{ let x := .1 }", ParserError, "Invalid number literal."); + CHECK_PARSE_ERROR("{ let x := 1e5 }", ParserError, "Invalid number literal."); + CHECK_PARSE_ERROR("{ let x := 67.235 }", ParserError, "Invalid number literal."); +} + BOOST_AUTO_TEST_CASE(function_definitions) { BOOST_CHECK(successParse("{ function f() { } function g(a) -> x { } }")); |