aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2017-06-17 23:21:46 +0800
committerFederico Bond <federicobond@gmail.com>2017-06-17 23:21:46 +0800
commitd170ceaf3d8f63536a730ccc6388183a7a483514 (patch)
tree3c91cb2455eae5fd5faeea8658a4e2ae259e4ae2 /test/libsolidity
parente0b9589e5a5b961541aefe783045b93fac347773 (diff)
downloaddexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.tar.gz
dexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.tar.zst
dexon-solidity-d170ceaf3d8f63536a730ccc6388183a7a483514.zip
Display error if payable or constant is specified multiple times
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityParser.cpp18
1 files changed, 18 insertions, 0 deletions
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"(