aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-02-12 04:40:47 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-02-14 06:16:14 +0800
commit60e839954ed2816f5b138e1bab618ebd58ad87ed (patch)
tree2fdd47723987d15ed304077b4404c387d8bf8821 /SolidityEndToEndTest.cpp
parent850350e7bc7dc037fff617331056ffcb9504b96f (diff)
downloaddexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar.gz
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar.bz2
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar.lz
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar.xz
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.tar.zst
dexon-solidity-60e839954ed2816f5b138e1bab618ebd58ad87ed.zip
Enums NameAndTypeResolution - WIP
- Also adding an EndToEnd enum test
Diffstat (limited to 'SolidityEndToEndTest.cpp')
-rw-r--r--SolidityEndToEndTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/SolidityEndToEndTest.cpp b/SolidityEndToEndTest.cpp
index 259123db..7fa7dd25 100644
--- a/SolidityEndToEndTest.cpp
+++ b/SolidityEndToEndTest.cpp
@@ -2499,6 +2499,26 @@ BOOST_AUTO_TEST_CASE(struct_copy_via_local)
BOOST_CHECK(callContractFunction("test()") == encodeArgs(true));
}
+BOOST_AUTO_TEST_CASE(using_enums)
+{
+ char const* sourceCode = R"(
+ contract test {
+ enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
+ function test()
+ {
+ choices = ActionChoices.GoStraight;
+ }
+ function getChoice() returns (uint d)
+ {
+ d = choices;
+ }
+ ActionChoices choices;
+ }
+ )";
+ compileAndRun(sourceCode);
+ BOOST_CHECK(callContractFunction("getChoice()") == encodeArgs(2));
+}
+
BOOST_AUTO_TEST_SUITE_END()
}