aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index 3f021708..3bb12f09 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5188,14 +5188,17 @@ BOOST_AUTO_TEST_CASE(storage_string_as_mapping_key_without_variable)
char const* sourceCode = R"(
contract Test {
mapping(string => uint) data;
- function f() returns (uint) {
- data["abc"] = 2;
- return data["abc"];
+ function f() returns (uint r, uint rl) {
+ mapping(string => uint) dataLocal;
+ dataLocal["abc"] = 2;
+ rl = dataLocal["abc"];
+ data["abc"] = 3;
+ r = data["abc"];
}
}
)";
compileAndRun(sourceCode, 0, "Test");
- BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(2)));
+ BOOST_CHECK(callContractFunction("f()") == encodeArgs(u256(3), u256(2)));
}
BOOST_AUTO_TEST_SUITE_END()