aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-08-08 18:59:55 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-08-08 19:42:10 +0800
commit8df89c5d5b349bbf366eaf410b59a9c85c8832ad (patch)
tree5a908888f2d0380653879f6673907e4ee6eca060 /test/libsolidity
parent1ada48f61e020a32c0c1f41394ded9a83d5ba57e (diff)
downloaddexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar.gz
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar.bz2
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar.lz
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar.xz
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.tar.zst
dexon-solidity-8df89c5d5b349bbf366eaf410b59a9c85c8832ad.zip
Disable unimplemented library functions instead
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp22
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()