1
0
Fork 0
mirror of https://github.com/Neargye/magic_enum.git synced 2026-01-10 23:44:29 +00:00

add compile check at enum_name

This commit is contained in:
Neargye 2020-01-25 23:51:50 +05:00
parent 6b220c83fc
commit e3dd165a4a
2 changed files with 4 additions and 5 deletions

View file

@ -271,7 +271,6 @@ TEST_CASE("enum_name") {
REQUIRE(cr_name == "RED");
REQUIRE(enum_name<Color::BLUE>() == "BLUE");
REQUIRE(enum_name<cm[1]>() == "GREEN");
REQUIRE(enum_name<static_cast<Color>(0)>().empty());
constexpr Numbers no = Numbers::one;
constexpr auto no_name = enum_name<no>();
@ -279,7 +278,6 @@ TEST_CASE("enum_name") {
REQUIRE(enum_name<Numbers::two>() == "two");
REQUIRE(enum_name<Numbers::three>() == "three");
REQUIRE(enum_name<Numbers::many>() == "many");
REQUIRE(enum_name<static_cast<Numbers>(0)>().empty());
constexpr Directions dr = Directions::Right;
constexpr auto dr_name = enum_name<dr>();
@ -287,7 +285,6 @@ TEST_CASE("enum_name") {
REQUIRE(enum_name<Directions::Down>() == "Down");
REQUIRE(dr_name == "Right");
REQUIRE(enum_name<Directions::Left>() == "Left");
REQUIRE(enum_name<static_cast<Directions>(0)>().empty());
constexpr number nt = number::three;
constexpr auto nt_name = enum_name<nt>();
@ -295,7 +292,6 @@ TEST_CASE("enum_name") {
REQUIRE(enum_name<number::two>() == "two");
REQUIRE(nt_name == "three");
REQUIRE(enum_name<number::four>() == "four");
REQUIRE(enum_name<static_cast<number>(0)>().empty());
}
}