From d170ceaf3d8f63536a730ccc6388183a7a483514 Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Sat, 17 Jun 2017 12:21:46 -0300 Subject: Display error if payable or constant is specified multiple times --- test/libsolidity/SolidityParser.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 27231b9b..78edd4d1 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -901,6 +901,24 @@ BOOST_AUTO_TEST_CASE(multiple_visibility_specifiers) CHECK_PARSE_ERROR(text, "Visibility already specified"); } +BOOST_AUTO_TEST_CASE(multiple_payable_specifiers) +{ + char const* text = R"( + contract c { + function f() payable payable {} + })"; + CHECK_PARSE_ERROR(text, "Multiple \"payable\" specifiers."); +} + +BOOST_AUTO_TEST_CASE(multiple_constant_specifiers) +{ + char const* text = R"( + contract c { + function f() constant constant {} + })"; + CHECK_PARSE_ERROR(text, "Multiple \"constant\" specifiers."); +} + BOOST_AUTO_TEST_CASE(literal_constants_with_ether_subdenominations) { char const* text = R"( -- cgit