From e1d2a3f398026fc55e18e609abe8bafb6f6ea089 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Sun, 20 Jan 2019 19:49:20 -0800 Subject: [PATCH] added leaf::failed test to handle_all_error_code_test --- test/handle_all_error_code_test.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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(); }