aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-08-21 18:08:29 +0800
committerchriseth <chris@ethereum.org>2017-08-21 19:31:28 +0800
commit2c5985de06b4ad35eaa77f3869e280440100c9cd (patch)
tree96fbdef7b3bf029d8f72ae9df53268375a952ca2 /test/libsolidity
parent83b90f3e8a3ee168ba00eff33c4443d00bbb8a57 (diff)
downloaddexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.gz
dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.tar.zst
dexon-solidity-2c5985de06b4ad35eaa77f3869e280440100c9cd.zip
Be more strict about number literals in assembly.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/InlineAssembly.cpp8
1 files changed, 8 insertions, 0 deletions
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 { } }"));