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

Function main

test/ctx_handle_some_test.cpp:30–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30int main()
31{
32 leaf::context<info<1>> ctx;
33
34 {
35 leaf::result<int> r1 = f(ctx);
36 BOOST_TEST(!r1);
37
38 leaf::result<int> r2 = ctx.handle_error<leaf::result<int>>(
39 r1.error(),
40 []( info<1> x ) -> leaf::result<int>
41 {
42 BOOST_TEST_EQ(x.value, 1);
43 return 1;
44 },
45 [&r1]
46 {
47 return std::move(r1);
48 } );
49 BOOST_TEST_EQ(r2.value(), 1);
50 }
51
52 return boost::report_errors();
53}

Callers

nothing calls this directly

Calls 3

report_errorsFunction · 0.85
fFunction · 0.70
valueMethod · 0.45

Tested by

no test coverage detected