aboutsummaryrefslogtreecommitdiffstats
path: root/SolidityEndToEndTest.cpp
diff options
context:
space:
mode:
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()
}