diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-12 04:40:47 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 06:16:14 +0800 |
commit | 60e839954ed2816f5b138e1bab618ebd58ad87ed (patch) | |
tree | 2fdd47723987d15ed304077b4404c387d8bf8821 /SolidityEndToEndTest.cpp | |
parent | 850350e7bc7dc037fff617331056ffcb9504b96f (diff) | |
download | dexon-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.cpp | 20 |
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() } |