diff options
author | Christian <c@ethdev.com> | 2015-01-21 18:16:18 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-26 17:23:39 +0800 |
commit | dabf94767920040a51dc20c5d4ab6655fc3ec63a (patch) | |
tree | 6b5d9fa635ea2a95e78cf1ca10d7ba7ba6c558bc /SolidityParser.cpp | |
parent | 99b31eab898119f8feb8238e0792c5826c662ad5 (diff) | |
download | dexon-solidity-dabf94767920040a51dc20c5d4ab6655fc3ec63a.tar.gz dexon-solidity-dabf94767920040a51dc20c5d4ab6655fc3ec63a.tar.zst dexon-solidity-dabf94767920040a51dc20c5d4ab6655fc3ec63a.zip |
Function modifier parsing.
Diffstat (limited to 'SolidityParser.cpp')
-rw-r--r-- | SolidityParser.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/SolidityParser.cpp b/SolidityParser.cpp index 91e57130..e476bee3 100644 --- a/SolidityParser.cpp +++ b/SolidityParser.cpp @@ -540,6 +540,33 @@ BOOST_AUTO_TEST_CASE(contract_multiple_inheritance_with_arguments) BOOST_CHECK_NO_THROW(parseText(text)); } +BOOST_AUTO_TEST_CASE(placeholder_in_function_context) +{ + char const* text = "contract c {\n" + " function fun() returns (uint r) {\n" + " var _ = 8;\n" + " return _ + 1;" + " }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseText(text)); +} + +BOOST_AUTO_TEST_CASE(modifier) +{ + char const* text = "contract c {\n" + " modifier mod { if (msg.sender == 0) _ }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseText(text)); +} + +BOOST_AUTO_TEST_CASE(modifier_arguments) +{ + char const* text = "contract c {\n" + " modifier mod(uint a) { if (msg.sender == a) _ }\n" + "}\n"; + BOOST_CHECK_NO_THROW(parseText(text)); +} + BOOST_AUTO_TEST_SUITE_END() } |