File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -46,3 +46,36 @@ TEST(GetNamespaceTest, ReturnsEmptyIfNoNamespace_PlainStruct) {
4646 constexpr auto kNs = ppc::util::GetNamespace<PlainType>();
4747 EXPECT_EQ (kNs , " " );
4848}
49+
50+ namespace test_ns {
51+ struct Nested {};
52+ } // namespace test_ns
53+
54+ TEST (GetNamespaceTest, ReturnsNamespaceCorrectly) {
55+ constexpr auto kNs = ppc::util::GetNamespace<test_ns::Nested>();
56+ EXPECT_EQ (kNs , " test_ns" );
57+ }
58+
59+ struct NoNamespaceType {};
60+
61+ TEST (GetNamespaceTest, NoNamespaceInType) {
62+ constexpr auto kNs = ppc::util::GetNamespace<NoNamespaceType>();
63+ EXPECT_EQ (kNs , " " );
64+ }
65+
66+ template <typename T>
67+ struct NotATemplate {};
68+
69+ TEST (GetNamespaceTest, NoKeyInPrettyFunction) {
70+ constexpr auto kNs = ppc::util::GetNamespace<NotATemplate<void >>();
71+ EXPECT_EQ (kNs , " " );
72+ }
73+
74+ namespace crazy {
75+ struct VeryLongTypeNameWithOnlyLettersAndUnderscores {};
76+ } // namespace crazy
77+
78+ TEST (GetNamespaceTest, NoTerminatorCharactersInPrettyFunction) {
79+ constexpr auto kNs = ppc::util::GetNamespace<crazy::VeryLongTypeNameWithOnlyLettersAndUnderscores>();
80+ EXPECT_EQ (kNs , " crazy" );
81+ }
You can’t perform that action at this time.
0 commit comments