From c7df6d03103093356323a3befbcd9d3e9cdfc117 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Mon, 11 Jan 2016 00:48:02 -0600 Subject: one last test for long strings --- test/libsolidity/SolidityEndToEndTest.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test/libsolidity') 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() } -- cgit