aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-08-22 00:17:05 +0800
committerchriseth <c@ethdev.com>2015-08-22 00:17:05 +0800
commit625be53252d6ef98a20b7e5abd3e675fcbc55c6b (patch)
tree6fdefe16fd29f36ca583f27472796feead5a33e9 /test/libsolidity/SolidityEndToEndTest.cpp
parentb999819d9938c248f060473ba13d3306a166a6f6 (diff)
parent1af8ff01215f4d6ab5d5b3b1c4e2d1785a69c9c9 (diff)
downloaddexon-solidity-625be53252d6ef98a20b7e5abd3e675fcbc55c6b.tar.gz
dexon-solidity-625be53252d6ef98a20b7e5abd3e675fcbc55c6b.tar.zst
dexon-solidity-625be53252d6ef98a20b7e5abd3e675fcbc55c6b.zip
Merge pull request #22 from LianaHus/sol_accessors_for_const_state_var
fixed the issue with accessors for constant state variables
Diffstat (limited to 'test/libsolidity/SolidityEndToEndTest.cpp')
-rw-r--r--test/libsolidity/SolidityEndToEndTest.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp
index ae2fc6dc..d74fd180 100644
--- a/test/libsolidity/SolidityEndToEndTest.cpp
+++ b/test/libsolidity/SolidityEndToEndTest.cpp
@@ -5161,6 +5161,27 @@ BOOST_AUTO_TEST_CASE(string_as_mapping_key)
) == encodeArgs(u256(7 + i)));
}
+BOOST_AUTO_TEST_CASE(accessor_for_state_variable)
+{
+ char const* sourceCode = R"(
+ contract Lotto{
+ uint public ticketPrice = 500;
+ })";
+
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("ticketPrice()") == encodeArgs(u256(500)));
+}
+
+BOOST_AUTO_TEST_CASE(accessor_for_const_state_variable)
+{
+ char const* sourceCode = R"(
+ contract Lotto{
+ uint constant public ticketPrice = 555;
+ })";
+
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("ticketPrice()") == encodeArgs(u256(555)));
+}
BOOST_AUTO_TEST_SUITE_END()
}