diff options
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 92f5a142..a81a9828 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -681,15 +681,23 @@ BOOST_AUTO_TEST_CASE(placeholder_in_function_context) BOOST_AUTO_TEST_CASE(modifier) { char const* text = "contract c {\n" - " modifier mod { if (msg.sender == 0) _ }\n" + " modifier mod { if (msg.sender == 0) _; }\n" "}\n"; BOOST_CHECK(successParse(text)); } +BOOST_AUTO_TEST_CASE(modifier_without_semicolon) +{ + char const* text = "contract c {\n" + " modifier mod { if (msg.sender == 0) _ }\n" + "}\n"; + BOOST_CHECK(!successParse(text)); +} + BOOST_AUTO_TEST_CASE(modifier_arguments) { char const* text = "contract c {\n" - " modifier mod(uint a) { if (msg.sender == a) _ }\n" + " modifier mod(uint a) { if (msg.sender == a) _; }\n" "}\n"; BOOST_CHECK(successParse(text)); } @@ -697,8 +705,8 @@ BOOST_AUTO_TEST_CASE(modifier_arguments) BOOST_AUTO_TEST_CASE(modifier_invocation) { char const* text = "contract c {\n" - " modifier mod1(uint a) { if (msg.sender == a) _ }\n" - " modifier mod2 { if (msg.sender == 2) _ }\n" + " modifier mod1(uint a) { if (msg.sender == a) _; }\n" + " modifier mod2 { if (msg.sender == 2) _; }\n" " function f() mod1(7) mod2 { }\n" "}\n"; BOOST_CHECK(successParse(text)); @@ -1223,6 +1231,16 @@ BOOST_AUTO_TEST_CASE(invalid_fixed_conversion_leading_zeroes_check) BOOST_CHECK(!successParse(text)); } +BOOST_AUTO_TEST_CASE(payable_accessor) +{ + char const* text = R"( + contract test { + uint payable x; + } + )"; + BOOST_CHECK(!successParse(text)); +} + BOOST_AUTO_TEST_SUITE_END() } |