aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-11-01 06:13:45 +0800
committerchriseth <c@ethdev.com>2015-11-01 06:13:45 +0800
commita5c227778d7f0145434147830bd07a16f0f72134 (patch)
treee92ab4d3ccd6bfbd7c0b89a9ffde4eb8d88f2251 /test
parent56f5d5885090a03ea9223f2210e70b6c78a1cb75 (diff)
downloaddexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.tar.gz
dexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.tar.zst
dexon-solidity-a5c227778d7f0145434147830bd07a16f0f72134.zip
Bugfix: Returning literal strings in tuples.
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index fb7c4013..460396a8 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5682,6 +5682,26 @@ BOOST_AUTO_TEST_CASE(tuples)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0)));
}
+BOOST_AUTO_TEST_CASE(string_tuples)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (string, uint) {
+ return ("abc", 8);
+ }
+ function g() returns (string, string) {
+ return (h(), "def");
+ }
+ function h() returns (string) {
+ return ("abc",);
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(0x40), u256(8), u256(3), string("abc")));
+ BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(0x40), u256(0x80), u256(3), string("abc"), u256(3), string("def")));
+}
+
BOOST_AUTO_TEST_CASE(destructuring_assignment)
{
char const* sourceCode = R"(