MCPcopy Create free account
hub / github.com/boostorg/leaf / test

Function test

test/exception_test.cpp:69–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68template <class Ex, class F>
69int test( F && f )
70{
71 return leaf::try_catch(
72 [&]() -> int
73 {
74 f();
75 return 0;
76 },
77
78 []( Ex ex, leaf::match_value<info,42>, leaf::e_source_location )
79 {
80 BOOST_TEST_EQ(get_val(ex), 42);
81 return 20;
82 },
83 []( Ex ex, leaf::match_value<info,42>, info )
84 {
85 BOOST_TEST_EQ(get_val(ex), 42);
86 return 21;
87 },
88 []( Ex ex, leaf::e_source_location )
89 {
90 BOOST_TEST_EQ(get_val(ex), 42);
91 return 22;
92 },
93 []( Ex ex )
94 {
95 BOOST_TEST_EQ(get_val(ex), 42);
96 return 23;
97 },
98 []( leaf::match_value<info,42>, leaf::e_source_location )
99 {
100 return 40;
101 },
102 []( leaf::match_value<info,42>, info )
103 {
104 return 41;
105 },
106 []( leaf::e_source_location )
107 {
108 return 42;
109 },
110 []
111 {
112 return 43;
113 } );
114}
115
116int main()
117{

Callers

nothing calls this directly

Calls 3

try_catchFunction · 0.85
get_valFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected