Skip to content

Commit

Permalink
Extra test case for hashing of enum key
Browse files Browse the repository at this point in the history
  • Loading branch information
serge-sans-paille-qb committed Jul 7, 2018
1 parent 2df60da commit 1e1b029
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test_unordered_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ TEST_CASE("frozen::unordered_set<int> <> std::unordered_set",

}

TEST_CASE("frozen::unordered_set with enum keys", "[unordered_set]") {
enum class some_enum {
A,B,C
};
constexpr frozen::unordered_set<some_enum, 2> frozen_set = { some_enum::A, some_enum::B };
REQUIRE(frozen_set.count(some_enum::A) == 1);
REQUIRE(frozen_set.count(some_enum::C) == 0);
}

TEST_CASE("frozen::unordered_set <> frozen::make_unordered_set", "[unordered_set]") {
constexpr frozen::unordered_set<int, 129> frozen_set = { INIT_SEQ };
constexpr auto frozen_set2 = frozen::make_unordered_set<int>({INIT_SEQ});
Expand Down

0 comments on commit 1e1b029

Please sign in to comment.