diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/fuzzer.cpp | 3 | ||||
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 30 |
2 files changed, 31 insertions, 2 deletions
diff --git a/test/fuzzer.cpp b/test/fuzzer.cpp index 85a8fe99..410313c5 100644 --- a/test/fuzzer.cpp +++ b/test/fuzzer.cpp @@ -67,7 +67,6 @@ int main() for (Json::Value const& error: outputJson["errors"]) { string invalid = contains(error.asString(), vector<string>{ - "Compiler error", "Internal compiler error", "Exception during compilation", "Unknown exception during compilation", @@ -78,7 +77,7 @@ int main() }); if (!invalid.empty()) { - cout << "Invalid error: \"" << invalid << "\"" << endl; + cout << "Invalid error: \"" << error.asString() << "\"" << endl; abort(); } } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index bb274614..3b137572 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2950,6 +2950,19 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration_wildcards_fail_6) CHECK_ERROR(text, TypeError, ""); } +BOOST_AUTO_TEST_CASE(tuple_assignment_from_void_function) +{ + char const* text = R"( + contract C { + function f() { } + function g() { + var (x,) = (f(), f()); + } + } + )"; + CHECK_ERROR(text, TypeError, "Cannot declare variable with void (empty tuple) type."); +} + BOOST_AUTO_TEST_CASE(member_access_parser_ambiguity) { char const* text = R"( @@ -4736,6 +4749,23 @@ BOOST_AUTO_TEST_CASE(delete_external_function_type_invalid) CHECK_ERROR(text, TypeError, ""); } +BOOST_AUTO_TEST_CASE(external_function_to_function_type_calldata_parameter) +{ + // This is a test that checks that the type of the `bytes` parameter is + // correctly changed from its own type `bytes calldata` to `bytes memory` + // when converting to a function type. + char const* text = R"( + contract C { + function f(function(bytes memory x) external g) { } + function callback(bytes x) external {} + function g() { + f(this.callback); + } + } + )"; + CHECK_SUCCESS(text); +} + BOOST_AUTO_TEST_CASE(external_function_type_to_address) { char const* text = R"( |