diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index ef83cc61..2fbc6ac8 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6536,28 +6536,26 @@ BOOST_AUTO_TEST_CASE(constructor_without_implementation) CHECK_ERROR(text, TypeError, "Constructor must be implemented if declared."); } -BOOST_AUTO_TEST_CASE(calling_unimplemented_internal_functions) +BOOST_AUTO_TEST_CASE(library_function_without_implementation) { char const* text = R"( - contract C { - function f() internal; - function g() { f(); } + library L { + function f(); } )"; CHECK_SUCCESS_NO_WARNINGS(text); -} - -BOOST_AUTO_TEST_CASE(calling_unimplemented_internal_library_functions) -{ - char const* text = R"( + text = R"( library L { function f() internal; } - contract C { - function g() { L.f(); } + )"; + CHECK_ERROR(text, TypeError, "Internal library function must be implemented if declared."); + text = R"( + library L { + function f() private; } )"; - CHECK_ERROR(text, TypeError, "Inlined library function is lacking implementation."); + CHECK_ERROR(text, TypeError, "Internal library function must be implemented if declared."); } BOOST_AUTO_TEST_SUITE_END() |