aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-12-18 22:56:26 +0800
committerchriseth <c@ethdev.com>2015-12-18 23:50:14 +0800
commit54e3637d234653e0f0e282220e3a628766a86adb (patch)
tree24673c46220072ed53017d15215507e200273778 /test/libsolidity/SolidityEndToEndTest.cpp
parent938ed70935a434babb8c52e6a2985b98216b37c6 (diff)
downloaddexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.gz
dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.tar.zst
dexon-solidity-54e3637d234653e0f0e282220e3a628766a86adb.zip
Add structs and enums to contract types.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index f625f533..d57360dc 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5377,6 +5377,21 @@ BOOST_AUTO_TEST_CASE(library_stray_values)
BOOST_CHECK(callContractFunction("f(uint256)", u256(33)) == encodeArgs(u256(42)));
}
+BOOST_AUTO_TEST_CASE(cross_contract_types)
+{
+ char const* sourceCode = R"(
+ contract Lib { struct S {uint a; uint b; } }
+ contract Test {
+ function f() returns (uint r) {
+ var x = Lib.S({a: 2, b: 3});
+ r = x.b;
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "Test");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(3)));
+}
+
BOOST_AUTO_TEST_CASE(simple_throw)
{
char const* sourceCode = R"(