Files
cpp-course/modules/09_cpp11/test/constexpr_nullptr_test.cpp
T

14 lines
335 B
C++
Raw Normal View History

2026-08-11 17:40:36 +03:00
#include "constexpr_nullptr.hpp"
#include <gtest/gtest.h>
TEST(ConstexprNullptr, EnumClass) {
EXPECT_EQ(cpp11::to_index(cpp11::Color::Green), 1);
EXPECT_EQ(cpp11::square(4), 16);
}
TEST(ConstexprNullptr, FindNull) {
int x = 1;
EXPECT_EQ(cpp11::find_null(&x), &x);
EXPECT_EQ(cpp11::find_null(nullptr), nullptr);
}