aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-17 00:32:54 +0800
committerchriseth <chris@ethereum.org>2018-02-22 22:17:43 +0800
commitad010f557bc4af683688aef423e7ae68d0fd4d08 (patch)
tree67800c552cac039812f3370b63b942e5845665c6 /test/libsolidity
parent8c1a8ecc2e6518dcfee73e6cd9ee8dd9a3eaaea0 (diff)
downloaddexon-solidity-ad010f557bc4af683688aef423e7ae68d0fd4d08.tar.gz
dexon-solidity-ad010f557bc4af683688aef423e7ae68d0fd4d08.tar.zst
dexon-solidity-ad010f557bc4af683688aef423e7ae68d0fd4d08.zip
Tests for warnings.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index ce80ffda..27761066 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -7818,6 +7818,29 @@ BOOST_AUTO_TEST_CASE(emit_events)
CHECK_SUCCESS_NO_WARNINGS(text);
}
+BOOST_AUTO_TEST_CASE(old_style_events_050)
+{
+ char const* text = R"(
+ contract C {
+ event e();
+ function f() public {
+ e();
+ }
+ }
+ )";
+ CHECK_WARNING(text, "without \"emit\" prefix");
+ text = R"(
+ pragma experimental "v0.5.0";
+ contract C {
+ event e();
+ function f() public {
+ e();
+ }
+ }
+ )";
+ CHECK_ERROR(text, TypeError, "have to be prefixed");
+}
+
BOOST_AUTO_TEST_SUITE_END()
}