Skip to content

Commit 038f64c

Browse files
Add trivial check for FoldType
Signed-off-by: Christian Parpart <[email protected]>
1 parent 125be08 commit 038f64c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test-reflection-cpp.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,13 @@ TEST_CASE("nested", "[reflection]")
6767
auto const result = Reflection::Inspect(ts);
6868
CHECK(result == R"(a=1 b=2 c=3 d="hello" e={name="John Doe" email="[email protected]" age=42})");
6969
}
70+
71+
TEST_CASE("FoldType", "[reflection]")
72+
{
73+
// clang-format off
74+
auto const result = Reflection::FoldType<TestStruct>(0, [](auto&& /*name*/, auto&& /*value*/, auto&& result) {
75+
return result + 1;
76+
});
77+
// clang-format on
78+
CHECK(result == 5);
79+
}

0 commit comments

Comments
 (0)