2
0
mirror of https://github.com/boostorg/leaf.git synced 2026-02-08 10:52:16 +00:00

added leaf::failed test to handle_all_error_code_test

This commit is contained in:
Emil Dotchevski
2019-01-20 19:49:20 -08:00
parent f0f8c9f523
commit e1d2a3f398

View File

@@ -66,5 +66,22 @@ int main()
} );
BOOST_TEST(r==1);
}
{
int r = leaf::handle_all(
[&]
{
return std::error_code(ENOENT,std::system_category());
},
[ ]( std::error_code const & )
{
return 1;
},
[ ]( leaf::failed<std::error_code> && ec )
{
BOOST_TEST(ec.value==std::error_code(ENOENT,std::system_category()));
return 2;
} );
BOOST_TEST(r==2);
}
return boost::report_errors();
}