aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-06 21:42:16 +0800
committerchriseth <c@ethdev.com>2017-03-06 21:42:28 +0800
commitfe5f85ef344dff2ecefb7ac3782221f9cf5effc1 (patch)
tree791cb13a975076a08cf50821274d29aed5a54f83 /test/libsolidity/SolidityEndToEndTest.cpp
parent573b885337aca75a025c08eea80bb109041e669e (diff)
downloaddexon-solidity-fe5f85ef344dff2ecefb7ac3782221f9cf5effc1.tar.gz
dexon-solidity-fe5f85ef344dff2ecefb7ac3782221f9cf5effc1.tar.zst
dexon-solidity-fe5f85ef344dff2ecefb7ac3782221f9cf5effc1.zip
Test for array singletons.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 130b0d3a..baed3f1e 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -7260,6 +7260,20 @@ BOOST_AUTO_TEST_CASE(inline_array_return)
BOOST_CHECK(callContractFunction("f()") == encodeArgs(1, 2, 3, 4, 5));
}
+BOOST_AUTO_TEST_CASE(inline_array_singleton)
+{
+ // This caused a failure since the type was not converted to its mobile type.
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (uint) {
+ return [4][0];
+ }
+ }
+ )";
+ compileAndRun(sourceCode, 0, "C");
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(4)));
+}
+
BOOST_AUTO_TEST_CASE(inline_long_string_return)
{
char const* sourceCode = R"(