diff --git a/test/entt/core/any.cpp b/test/entt/core/any.cpp index 41d665b49..696d6b819 100644 --- a/test/entt/core/any.cpp +++ b/test/entt/core/any.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -966,3 +967,17 @@ TEST_F(Any, AggregatesMustWork) { // the goal of this test is to enforce the requirements for aggregate types entt::any{std::in_place_type, 42}.emplace(42); } + +TEST_F(Any, DeducedArrayType) { + entt::any any{"array of char"}; + + ASSERT_TRUE(any); + ASSERT_EQ(any.type(), entt::type_id()); + ASSERT_EQ((std::strcmp("array of char", entt::any_cast(any))), 0); + + any = "another array of char"; + + ASSERT_TRUE(any); + ASSERT_EQ(any.type(), entt::type_id()); + ASSERT_EQ((std::strcmp("another array of char", entt::any_cast(any))), 0); +}