aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityParser.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-05 20:54:50 +0800
committerchriseth <c@ethdev.com>2016-09-05 20:54:50 +0800
commit02984b8de11a9dc6ab88788bfae82530b073f1f6 (patch)
tree754aaa2856d7c57c1ff45b8a8894812ebce752fc /test/libsolidity/SolidityParser.cpp
parent341c9436a8b6f5ae49265a482519e165a7f40395 (diff)
downloaddexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar.gz
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar.bz2
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar.lz
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar.xz
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.tar.zst
dexon-solidity-02984b8de11a9dc6ab88788bfae82530b073f1f6.zip
Require ";" after "_"
Diffstat (limited to 'test/libsolidity/SolidityParser.cpp')
-rw-r--r--test/libsolidity/SolidityParser.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityParser.cpp b/test/libsolidity/SolidityParser.cpp
index 92f5a142..0c0e343b 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));