diff options
author | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-10 21:51:40 +0800 |
---|---|---|
committer | Lefteris Karapetsas <lefteris@refu.co> | 2015-02-14 06:16:14 +0800 |
commit | 76d659dbe244c0934a0c3ca0284f2562d1872957 (patch) | |
tree | a0eda493559481ea52fa96e817e7946ff74b3df3 | |
parent | 3c0355c0243bf234d0129101285897aaf8c0b36b (diff) | |
download | dexon-solidity-76d659dbe244c0934a0c3ca0284f2562d1872957.tar.gz dexon-solidity-76d659dbe244c0934a0c3ca0284f2562d1872957.tar.zst dexon-solidity-76d659dbe244c0934a0c3ca0284f2562d1872957.zip |
Adding test for Enum Parsing
-rw-r--r-- | SolidityParser.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/SolidityParser.cpp b/SolidityParser.cpp index 84f36170..035bfd78 100644 --- a/SolidityParser.cpp +++ b/SolidityParser.cpp @@ -703,6 +703,20 @@ BOOST_AUTO_TEST_CASE(literal_constants_with_ether_subdenominations_in_expression BOOST_CHECK_NO_THROW(parseTextExplainError(text)); } +BOOST_AUTO_TEST_CASE(enum_declaration) +{ + char const* text = R"( + contract c { + enum foo { WARNING, NOTICE, ERROR, CRITICAL }; + function c () + { + a = foo.CRITICAL; + } + uint256 a; + })"; + BOOST_CHECK_NO_THROW(parseTextExplainError(text)); +} + BOOST_AUTO_TEST_SUITE_END() } |