diff options
author | chriseth <chris@ethereum.org> | 2018-10-19 17:20:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 17:20:12 +0800 |
commit | c13b5280c1b44f18a2a1fb61ef5556e91c5678e7 (patch) | |
tree | e5a568e2a1446e91059768976248c6a1b2f3d5c0 /test/libsolidity/SolidityEndToEndTest.cpp | |
parent | c676b009e1de3e8f87d43342d6f82d687acbe7fa (diff) | |
parent | c14dfeb8c5ffcc15cff1014a39ffa425aee1430a (diff) | |
download | dexon-solidity-c13b5280c1b44f18a2a1fb61ef5556e91c5678e7.tar.gz dexon-solidity-c13b5280c1b44f18a2a1fb61ef5556e91c5678e7.tar.zst dexon-solidity-c13b5280c1b44f18a2a1fb61ef5556e91c5678e7.zip |
Merge pull request #5256 from ethereum/lvalueCleanup
Lvalue cleanup
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 133387c8..8d17e56f 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1787,6 +1787,24 @@ BOOST_AUTO_TEST_CASE(deleteLocals) ABI_CHECK(callContractFunction("delLocal()"), encodeArgs(6, 7)); } +BOOST_AUTO_TEST_CASE(deleteLength) +{ + char const* sourceCode = R"( + contract test { + uint[] x; + function f() public returns (uint){ + x.length = 1; + x[0] = 1; + delete x.length; + return x.length; + } + } + )"; + compileAndRun(sourceCode); + ABI_CHECK(callContractFunction("f()"), encodeArgs(0)); + BOOST_CHECK(storageEmpty(m_contractAddress)); +} + BOOST_AUTO_TEST_CASE(constructor) { char const* sourceCode = R"( |