aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2016-01-11 14:48:02 +0800
committerRJ Catalano <catalanor0220@gmail.com>2016-01-11 14:48:02 +0800
commitc7df6d03103093356323a3befbcd9d3e9cdfc117 (patch)
tree6adaeef043ce3dae3d2b2b00eb2ded378636369c /test
parentc348791fa164841a8712cced711cdac321c20f62 (diff)
downloaddexon-solidity-c7df6d03103093356323a3befbcd9d3e9cdfc117.tar.gz
dexon-solidity-c7df6d03103093356323a3befbcd9d3e9cdfc117.tar.zst
dexon-solidity-c7df6d03103093356323a3befbcd9d3e9cdfc117.zip
one last test for long strings
Diffstat (limited to 'test')
-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 8be158fb..3136d43f 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -6188,6 +6188,21 @@ BOOST_AUTO_TEST_CASE(inline_array_return)
compileAndRun(sourceCode, 0, "C");
BOOST_CHECK(callContractFunction("f()") == encodeArgs(1, 2, 3, 4, 5));
}
+
+BOOST_AUTO_TEST_CASE(inline_long_string_return)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (string) {
+ return (["somethingShort", "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"][1]);
+ }
+ }
+ )";
+
+ string strLong = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789001234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeDyn(strLong));
+}
BOOST_AUTO_TEST_SUITE_END()
}