mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Test cases.
This commit is contained in:
parent
4bfe09897e
commit
546aca2a3e
@ -2541,6 +2541,19 @@ BOOST_AUTO_TEST_CASE(inherited_fallback_function)
|
||||
BOOST_CHECK(callContractFunction("getData()") == encodeArgs(1));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(default_fallback_throws)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract A {
|
||||
function f() returns (bool) {
|
||||
return this.call();
|
||||
}
|
||||
}
|
||||
)";
|
||||
compileAndRun(sourceCode);
|
||||
BOOST_CHECK(callContractFunction("f()") == encodeArgs(0));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(event)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
|
@ -1102,6 +1102,16 @@ BOOST_AUTO_TEST_CASE(fallback_function_with_arguments)
|
||||
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(fallback_function_in_library)
|
||||
{
|
||||
char const* text = R"(
|
||||
library C {
|
||||
function() {}
|
||||
}
|
||||
)";
|
||||
BOOST_CHECK(expectError(text) == Error::Type::TypeError);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(fallback_function_with_return_parameters)
|
||||
{
|
||||
char const* text = R"(
|
||||
|
Loading…
Reference in New Issue
Block a user