aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2016-01-04 16:11:13 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2016-01-04 16:11:43 +0800
commit208429644dbf646e90107447b148e7edb6c36512 (patch)
treef046ff2e8c19e016261beba391a074bf41cbc1c4 /test/libsolidity/SolidityEndToEndTest.cpp
parent568da1136992f8f188ba419bef814659f7a7794a (diff)
downloaddexon-solidity-208429644dbf646e90107447b148e7edb6c36512.tar.gz
dexon-solidity-208429644dbf646e90107447b148e7edb6c36512.tar.zst
dexon-solidity-208429644dbf646e90107447b148e7edb6c36512.zip
add a test case for decayed tuple expression as left value
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 d57360dc..2f627fc2 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5785,6 +5785,21 @@ BOOST_AUTO_TEST_CASE(string_tuples)
BOOST_CHECK(callContractFunction("g()") == encodeArgs(u256(0x40), u256(0x80), u256(3), string("abc"), u256(3), string("def")));
}
+BOOST_AUTO_TEST_CASE(decayed_tuple)
+{
+ char const* sourceCode = R"(
+ contract C {
+ function f() returns (uint) {
+ uint x = 1;
+ (x) = 2;
+ return x;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(2)));
+}
+
BOOST_AUTO_TEST_CASE(destructuring_assignment)
{
char const* sourceCode = R"(