🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
589 B

#include <gtest/gtest.h>
#include <entt/core/hashed_string.hpp>
#include <entt/core/monostate.hpp>
TEST(Monostate, Functionalities) {
const bool b_pre = entt::monostate<entt::hashed_string{"foobar"}>{};
const int i_pre = entt::monostate<"foobar"_hs>{};
ASSERT_FALSE(b_pre);
ASSERT_EQ(i_pre, int{});
entt::monostate<"foobar"_hs>{} = true;
entt::monostate_v<"foobar"_hs> = 42;
const bool &b_post = entt::monostate<"foobar"_hs>{};
const int &i_post = entt::monostate_v<entt::hashed_string{"foobar"}>;
ASSERT_TRUE(b_post);
ASSERT_EQ(i_post, 42);
}