diff options
author | chriseth <chris@ethereum.org> | 2017-06-14 21:31:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-14 21:31:40 +0800 |
commit | 1ae0e082b316adfc1a048928e5c535559d3780b3 (patch) | |
tree | ffa909bd5e932148a3d923149f11738431559c28 /test/libsolidity | |
parent | 0b99c81f8536aa7888f26ac349ab233825350efc (diff) | |
parent | fd8365df08aafc7ab7cfac5fa916d910343d0eb3 (diff) | |
download | dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar.gz dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar.bz2 dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar.lz dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar.xz dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.tar.zst dexon-solidity-1ae0e082b316adfc1a048928e5c535559d3780b3.zip |
Merge pull request #2392 from federicobond/disallow-trailing-commas
Forbid trailing commas in named arguments
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityParser.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp index 31dfada9..27231b9b 100644 --- a/test/libsolidity/SolidityParser.cpp +++ b/test/libsolidity/SolidityParser.cpp @@ -199,6 +199,17 @@ BOOST_AUTO_TEST_CASE(missing_argument_in_named_args) CHECK_PARSE_ERROR(text, "Expected primary expression"); } +BOOST_AUTO_TEST_CASE(trailing_comma_in_named_args) +{ + char const* text = R"( + contract test { + function a(uint a, uint b, uint c) returns (uint r) { r = a * 100 + b * 10 + c * 1; } + function b() returns (uint r) { r = a({a: 1, b: 2, c: 3, }); } + } + )"; + CHECK_PARSE_ERROR(text, "Unexpected trailing comma"); +} + BOOST_AUTO_TEST_CASE(two_exact_functions) { char const* text = R"( |