aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorsubtly <subtly@users.noreply.github.com>2015-04-28 21:19:06 +0800
committersubtly <subtly@users.noreply.github.com>2015-04-28 21:19:06 +0800
commite3a2d037e44de6c060e605161848f17e4140f9e4 (patch)
treea60d8df6b73ff84cf47fa7292f32d9326d018b95 /libsolidity/SolidityEndToEndTest.cpp
parent8d8f7c69286b6e7b73d4f1560d2d0d4d61317153 (diff)
parent717f2559696380c51d39cbf0105785c85ce3f3cf (diff)
downloaddexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar.gz
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar.bz2
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar.lz
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar.xz
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.tar.zst
dexon-solidity-e3a2d037e44de6c060e605161848f17e4140f9e4.zip
Merge branch 'develop' into discovery
Diffstat (limited to 'libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--libsolidity/SolidityEndToEndTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/libsolidity/SolidityEndToEndTest.cpp b/libsolidity/SolidityEndToEndTest.cpp
index 596f710b..24e5f7b4 100644
--- a/libsolidity/SolidityEndToEndTest.cpp
+++ b/libsolidity/SolidityEndToEndTest.cpp
@@ -3381,6 +3381,26 @@ BOOST_AUTO_TEST_CASE(bytes_index_access)
BOOST_CHECK(callContractFunction("storageWrite()") == encodeArgs(0x193));
}
+BOOST_AUTO_TEST_CASE(bytes_delete_element)
+{
+ char const* sourceCode = R"(
+ contract c {
+ bytes data;
+ function test1() external returns (bool) {
+ data.length = 100;
+ for (uint i = 0; i < data.length; i++)
+ data[i] = byte(i);
+ delete data[94];
+ delete data[96];
+ delete data[98];
+ return data[94] == 0 && data[95] == 95 && data[96] == 0 && data[97] == 97;
+ }
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("test1()") == encodeArgs(true));
+}
+
BOOST_AUTO_TEST_CASE(array_copy_calldata_storage)
{
char const* sourceCode = R"(