diff options
author | chriseth <c@ethdev.com> | 2015-10-05 23:19:23 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-06 20:20:06 +0800 |
commit | bc609c55c0fa622a68fa9718c55046416c201b1d (patch) | |
tree | 0757a485f2e6c0e0c70bb924c4b4acfac53aec5c /test/libsolidity/SolidityInterface.cpp | |
parent | ce25ddfa6a9b8cfff08b4a05591dcc3b4a8b63cc (diff) | |
download | dexon-solidity-bc609c55c0fa622a68fa9718c55046416c201b1d.tar.gz dexon-solidity-bc609c55c0fa622a68fa9718c55046416c201b1d.tar.zst dexon-solidity-bc609c55c0fa622a68fa9718c55046416c201b1d.zip |
Compute canonical names of types for function signatures.
Diffstat (limited to 'test/libsolidity/SolidityInterface.cpp')
-rw-r--r-- | test/libsolidity/SolidityInterface.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityInterface.cpp b/test/libsolidity/SolidityInterface.cpp index d77bccbd..4006968a 100644 --- a/test/libsolidity/SolidityInterface.cpp +++ b/test/libsolidity/SolidityInterface.cpp @@ -142,6 +142,21 @@ BOOST_AUTO_TEST_CASE(inheritance) sourcePart(*contract.definedFunctions().at(1))})); } +BOOST_AUTO_TEST_CASE(libraries) +{ + char const* sourceCode = R"( + library Lib { + struct Str { uint a; } + enum E { E1, E2 } + function f(uint[] x,Str storage y,E z) external; + } + )"; + ContractDefinition const& contract = checkInterface(sourceCode); + set<string> expectedFunctions({"function f(uint256[] x,Lib.Str y,Lib.E z);"}); + BOOST_REQUIRE_EQUAL(1, contract.definedFunctions().size()); + BOOST_CHECK(expectedFunctions == set<string>({sourcePart(*contract.definedFunctions().at(0))})); +} + BOOST_AUTO_TEST_SUITE_END() } |