diff options
author | chriseth <chris@ethereum.org> | 2017-06-15 00:35:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 00:35:16 +0800 |
commit | fd5bf16101d514d77cf4c7c64de367ec398995a2 (patch) | |
tree | 747e33bfd3c8c8ccf189b3eb1d237f44b85fe131 /test | |
parent | d693822a6fce5d1c853e50f4c7758bc003542644 (diff) | |
parent | 98139ead42e8641f99eb98cbe7997493f03ae099 (diff) | |
download | dexon-solidity-fd5bf16101d514d77cf4c7c64de367ec398995a2.tar.gz dexon-solidity-fd5bf16101d514d77cf4c7c64de367ec398995a2.tar.zst dexon-solidity-fd5bf16101d514d77cf4c7c64de367ec398995a2.zip |
Merge pull request #2384 from ethereum/parseFunctionalInstructions
Enforce function arguments when parsing functional instructions.
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/InlineAssembly.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index 435c3dad..7876b7ee 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -213,6 +213,16 @@ BOOST_AUTO_TEST_CASE(functional) BOOST_CHECK(successParse("{ let x := 2 add(7, mul(6, x)) mul(7, 8) add =: x }")); } +BOOST_AUTO_TEST_CASE(functional_partial) +{ + CHECK_PARSE_ERROR("{ let x := byte }", ParserError, "Expected token \"(\""); +} + +BOOST_AUTO_TEST_CASE(functional_partial_success) +{ + BOOST_CHECK(successParse("{ let x := byte(1, 2) }")); +} + BOOST_AUTO_TEST_CASE(functional_assignment) { BOOST_CHECK(successParse("{ let x := 2 x := 7 }")); @@ -258,7 +268,7 @@ BOOST_AUTO_TEST_CASE(switch_duplicate_case) BOOST_AUTO_TEST_CASE(switch_invalid_expression) { CHECK_PARSE_ERROR("{ switch {} default {} }", ParserError, "Literal, identifier or instruction expected."); - CHECK_PARSE_ERROR("{ 1 2 switch mul default {} }", ParserError, "Instructions are not supported as expressions for switch."); + CHECK_PARSE_ERROR("{ switch calldatasize default {} }", ParserError, "Instructions are not supported as expressions for switch."); } BOOST_AUTO_TEST_CASE(switch_default_before_case) |