diff options
author | chriseth <chris@ethereum.org> | 2017-08-21 18:08:29 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-08-21 19:31:28 +0800 |
commit | 2c5985de06b4ad35eaa77f3869e280440100c9cd (patch) | |
tree | 96fbdef7b3bf029d8f72ae9df53268375a952ca2 /test/libjulia/Parser.cpp | |
parent | 83b90f3e8a3ee168ba00eff33c4443d00bbb8a57 (diff) | |
download | dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.gz dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.bz2 dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.lz dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.xz dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.zst dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.zip |
Be more strict about number literals in assembly.
Diffstat (limited to 'test/libjulia/Parser.cpp')
-rw-r--r-- | test/libjulia/Parser.cpp | 8 |
1 files changed, 8 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 }")); |