MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

util/generic/overloaded_ut.cpp:17–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16Y_UNIT_TEST_SUITE(TOverloadedTest) {
17 Y_UNIT_TEST(StaticTest) {
18 auto f = TOverloaded{
19 [](const TType1&) {},
20 [](const TType2&) {},
21 [](const TType3&) {}};
22 using F = decltype(f);
23 static_assert(std::is_invocable_v<F, TType1>);
24 static_assert(std::is_invocable_v<F, TType2>);
25 static_assert(std::is_invocable_v<F, TType3>);
26 static_assert(!std::is_invocable_v<F, int>);
27 static_assert(!std::is_invocable_v<F, double>);
28 }
29
30 Y_UNIT_TEST(VariantTest) {
31 std::variant<int, double, TType1> v = 5;

Callers

nothing calls this directly

Calls 3

ForEachFunction · 0.70
visitFunction · 0.50
ToStringFunction · 0.50

Tested by

no test coverage detected