diff --git a/src/include/object.hpp b/src/include/object.hpp index 169bd37..a83f7d3 100644 --- a/src/include/object.hpp +++ b/src/include/object.hpp @@ -72,8 +72,7 @@ public: template struct is_backing::value>::type> { - static constexpr bool value = std::is_same::key_type, std::string>::value - && std::is_same::value_type, object>::value; + static constexpr bool value = std::is_same::key_type, std::string>::value; using type = map_t; }; diff --git a/src/test/object.cpp b/src/test/object.cpp index 9fbab7a..f8142e0 100644 --- a/src/test/object.cpp +++ b/src/test/object.cpp @@ -148,6 +148,30 @@ TEST(ObjectTest, basic_has_unordered_set) { EXPECT_FALSE(obj.has>()); } +using map_str_str = std::map; +using map_str_strv = std::map; +using map_str_obj = std::map; + +using unordered_map_str_str = std::unordered_map; +using unordered_map_str_strv = std::unordered_map; +using unordered_map_str_obj = std::unordered_map; + +TEST(ObjectTest, basic_has_map) { + object obj; + + EXPECT_FALSE(obj.has()); + EXPECT_FALSE(obj.has()); + EXPECT_FALSE(obj.has()); +} + +TEST(ObjectTest, basic_has_unordered_map) { + object obj; + + EXPECT_FALSE(obj.has()); + EXPECT_FALSE(obj.has()); + EXPECT_FALSE(obj.has()); +} + /** basic_get tests */ TEST(ObjectTest, basic_get) { @@ -301,7 +325,7 @@ TEST(ObjectTest, basic_get_unordered_multiset) { { object test_object__{ in_type {} }; \ EXPECT_TRUE(test_object__ .has< in_type >()); \ EXPECT_EQ(test_object__.get< in_type >(), in_type {} ); } - + // asdf TEST(ObjectTest, basic_value_constructor) { @@ -445,7 +469,7 @@ TEST(ObjectTest, basic_value_constructor_unordered_multiset) { OBJECT_BASIC_VALUE_CONSTRUCTOR_TEST(std::unordered_multiset); OBJECT_BASIC_VALUE_CONSTRUCTOR_TEST(std::unordered_set); } - + /** basic_set */ #define OBJECT_BASIC_SET_TEST(in_object, in_type) \