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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user