aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-09-06 16:58:56 +0800
committerchriseth <c@ethdev.com>2016-09-06 16:58:56 +0800
commit384f189a6adffa7b1879bb06ded4453ef5f00dcb (patch)
treed3a57bda669a8f693d86342af8dcdfd8c6dddd28 /test
parentff11aa192708620de538ed8676136eb616abc74e (diff)
downloaddexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.gz
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.tar.zst
dexon-solidity-384f189a6adffa7b1879bb06ded4453ef5f00dcb.zip
Tests for payable / private combination.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index 29c0ccba..ab0f9c7b 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -3865,6 +3865,16 @@ BOOST_AUTO_TEST_CASE(payable_in_library)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(payable_external)
+{
+ char const* text = R"(
+ contract test {
+ function f() payable external {}
+ }
+ )";
+ BOOST_CHECK(success(text));
+}
+
BOOST_AUTO_TEST_CASE(payable_internal)
{
char const* text = R"(
@@ -3875,6 +3885,16 @@ BOOST_AUTO_TEST_CASE(payable_internal)
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
}
+BOOST_AUTO_TEST_CASE(payable_private)
+{
+ char const* text = R"(
+ contract test {
+ function f() payable private {}
+ }
+ )";
+ BOOST_CHECK(expectError(text) == Error::Type::TypeError);
+}
+
BOOST_AUTO_TEST_CASE(illegal_override_payable)
{
char const* text = R"(