diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-05 00:35:01 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-13 02:33:52 +0800 |
commit | 62645d530253c365ac09979135e9037f2bde2934 (patch) | |
tree | 2d62564d9208f14f0e807d14fa2b5dd977acdaaa /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | 6f383e162648766d0cc804fe4cbb5760b48953a2 (diff) | |
download | dexon-solidity-62645d530253c365ac09979135e9037f2bde2934.tar.gz dexon-solidity-62645d530253c365ac09979135e9037f2bde2934.tar.zst dexon-solidity-62645d530253c365ac09979135e9037f2bde2934.zip |
Update tests.
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index ad425d98..bee83007 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -8091,17 +8091,36 @@ BOOST_AUTO_TEST_CASE(multi_variable_declaration) function g() public returns (uint a, uint b, uint c) { a = 1; b = 2; c = 3; } - function f() public returns (bool) { + function h() public returns (uint a, uint b, uint c, uint d) { + a = 1; b = 2; c = 3; d = 4; + } + function f1() public returns (bool) { (uint x, uint y, uint z) = g(); if (x != 1 || y != 2 || z != 3) return false; (, uint a,) = g(); if (a != 2) return false; - (uint b,) = g(); + (uint b, , ) = g(); if (b != 1) return false; - (, uint c) = g(); + (, , uint c) = g(); if (c != 3) return false; return true; } + function f2() public returns (bool) { + (uint a1, , uint a3, ) = h(); + if (a1 != 1 || a3 != 3) return false; + (uint b1, uint b2, , ) = h(); + if (b1 != 1 || b2 != 2) return false; + (, uint c2, uint c3, ) = h(); + if (c2 != 2 || c3 != 3) return false; + (, , uint d3, uint d4) = h(); + if (d3 != 3 || d4 != 4) return false; + (uint e1, , uint e3, uint e4) = h(); + if (e1 != 1 || e3 != 3 || e4 != 4) return false; + return true; + } + function f() public returns (bool) { + return f1() && f2(); + } } )"; compileAndRun(sourceCode); |