Browse Source

type_traits: add tests for is_ebco_eligible_v

Michele Caini 4 years ago
parent
commit
0fb86f21e4
1 changed files with 8 additions and 1 deletions
  1. 8 1
      test/entt/core/type_traits.cpp

+ 8 - 1
test/entt/core/type_traits.cpp

@@ -12,7 +12,7 @@ struct not_comparable {
     bool operator==(const not_comparable &) const = delete;
 };
 
-struct nlohmann_json_like {
+struct nlohmann_json_like final {
     using value_type = nlohmann_json_like;
 
     bool operator==(const nlohmann_json_like &) const {
@@ -153,6 +153,13 @@ TEST(TypeTraits, IsIteratorType) {
     static_assert(entt::is_iterator_type_v<std::vector<int>::iterator, std::reverse_iterator<std::reverse_iterator<std::vector<int>::iterator>>>);
 }
 
+TEST(TypeTraits, IsEBCOEligible) {
+    static_assert(entt::is_ebco_eligible_v<not_comparable>);
+    static_assert(!entt::is_ebco_eligible_v<nlohmann_json_like>);
+    static_assert(!entt::is_ebco_eligible_v<double>);
+    static_assert(!entt::is_ebco_eligible_v<void>);
+}
+
 TEST(TypeTraits, ConstnessAs) {
     static_assert(std::is_same_v<entt::constness_as_t<int, char>, int>);
     static_assert(std::is_same_v<entt::constness_as_t<const int, char>, int>);