diff options
author | Gav Wood <g@ethdev.com> | 2015-08-28 04:36:35 +0800 |
---|---|---|
committer | Gav Wood <g@ethdev.com> | 2015-08-28 04:36:35 +0800 |
commit | 714223f552ea16b2ab0dcc42374994811e3ac249 (patch) | |
tree | b26a59e7eedf52b43c79c9d0ee1b9b7ac84086c9 | |
parent | 91cffa0d5dbcc44b5f4bebe95f331453f23d768c (diff) | |
parent | 4c7777128b172e19b916afc474e54464a5f29051 (diff) | |
download | dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar.gz dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar.bz2 dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar.lz dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar.xz dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.tar.zst dexon-solidity-714223f552ea16b2ab0dcc42374994811e3ac249.zip |
Merge pull request #25 from LianaHus/sol_strings_as_mapping_keys
added check for string as mapping key for local var.
-rw-r--r-- | test/libsolidity/SolidityEndToEndTest.cpp | 11 |
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() |