mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Removing ';' from the end of EnumDefinition
This commit is contained in:
parent
8e9a9ad5e9
commit
9836d58df8
@ -2503,7 +2503,7 @@ BOOST_AUTO_TEST_CASE(using_enums)
|
|||||||
{
|
{
|
||||||
char const* sourceCode = R"(
|
char const* sourceCode = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
choices = ActionChoices.GoStraight;
|
choices = ActionChoices.GoStraight;
|
||||||
|
@ -996,7 +996,7 @@ BOOST_AUTO_TEST_CASE(enum_member_access)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
choices = ActionChoices.GoStraight;
|
choices = ActionChoices.GoStraight;
|
||||||
@ -1011,7 +1011,7 @@ BOOST_AUTO_TEST_CASE(enum_invalid_member_access)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
choices = ActionChoices.RunAroundWavingYourHands;
|
choices = ActionChoices.RunAroundWavingYourHands;
|
||||||
@ -1026,7 +1026,7 @@ BOOST_AUTO_TEST_CASE(enum_explicit_conversion_is_okay)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
a = uint256(ActionChoices.GoStraight);
|
a = uint256(ActionChoices.GoStraight);
|
||||||
@ -1043,7 +1043,7 @@ BOOST_AUTO_TEST_CASE(int_to_enum_explicit_conversion_is_okay)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
a = 2;
|
a = 2;
|
||||||
@ -1060,7 +1060,7 @@ BOOST_AUTO_TEST_CASE(enum_implicit_conversion_is_not_okay)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoStraight, Sit }
|
||||||
function test()
|
function test()
|
||||||
{
|
{
|
||||||
a = ActionChoices.GoStraight;
|
a = ActionChoices.GoStraight;
|
||||||
@ -1077,7 +1077,7 @@ BOOST_AUTO_TEST_CASE(enum_duplicate_values)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract test {
|
contract test {
|
||||||
enum ActionChoices { GoLeft, GoRight, GoLeft, Sit };
|
enum ActionChoices { GoLeft, GoRight, GoLeft, Sit }
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
BOOST_CHECK_THROW(parseTextAndResolveNames(text), TypeError);
|
||||||
|
@ -707,7 +707,7 @@ BOOST_AUTO_TEST_CASE(enum_valid_declaration)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
enum validEnum { Value1, Value2, Value3, Value4 };
|
enum validEnum { Value1, Value2, Value3, Value4 }
|
||||||
function c ()
|
function c ()
|
||||||
{
|
{
|
||||||
a = foo.Value3;
|
a = foo.Value3;
|
||||||
@ -721,7 +721,7 @@ BOOST_AUTO_TEST_CASE(empty_enum_declaration)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
enum foo { };
|
enum foo { }
|
||||||
})";
|
})";
|
||||||
BOOST_CHECK_NO_THROW(parseTextExplainError(text));
|
BOOST_CHECK_NO_THROW(parseTextExplainError(text));
|
||||||
}
|
}
|
||||||
@ -730,7 +730,7 @@ BOOST_AUTO_TEST_CASE(malformed_enum_declaration)
|
|||||||
{
|
{
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
contract c {
|
contract c {
|
||||||
enum foo { WARNING,};
|
enum foo { WARNING,}
|
||||||
})";
|
})";
|
||||||
BOOST_CHECK_THROW(parseText(text), ParserError);
|
BOOST_CHECK_THROW(parseText(text), ParserError);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user