diff --git a/test/handle_all_error_code_test.cpp b/test/handle_all_error_code_test.cpp index d7805d2..0a82390 100644 --- a/test/handle_all_error_code_test.cpp +++ b/test/handle_all_error_code_test.cpp @@ -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 && ec ) + { + BOOST_TEST(ec.value==std::error_code(ENOENT,std::system_category())); + return 2; + } ); + BOOST_TEST(r==2); + } return boost::report_errors(); }