From eb05ab5faba10d41934231908a3dadf637af91d9 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Mon, 29 Mar 2021 23:30:13 +0200 Subject: [PATCH] test: code coverage --- test/entt/meta/meta_any.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/entt/meta/meta_any.cpp b/test/entt/meta/meta_any.cpp index 2e9f66f87..f53ff29d6 100644 --- a/test/entt/meta/meta_any.cpp +++ b/test/entt/meta/meta_any.cpp @@ -651,6 +651,14 @@ TEST_F(MetaAny, AsRef) { ASSERT_EQ(cref.cast(), 42); ASSERT_NE(ref.try_cast(), any.data()); ASSERT_NE(cref.try_cast(), any.data()); + + any.emplace(); + ref = any.as_ref(); + cref = std::as_const(any).as_ref(); + + ASSERT_TRUE(ref); + ASSERT_EQ(ref.type(), cref.type()); + ASSERT_EQ(ref.type(), entt::resolve()); } TEST_F(MetaAny, Comparable) {