2
0
mirror of https://github.com/boostorg/leaf.git synced 2026-02-22 15:32:24 +00:00
This commit is contained in:
Emil Dotchevski
2026-02-18 15:25:29 -05:00
parent bd58aa238c
commit e8fe60e0cc
6 changed files with 115 additions and 8 deletions

View File

@@ -9,6 +9,7 @@
# include <boost/leaf/handle_errors.hpp>
#endif
#include "_test_res.hpp"
#include "lightweight_test.hpp"
#ifdef BOOST_LEAF_BOOST_AVAILABLE
# include <boost/config/workaround.hpp>
@@ -95,5 +96,18 @@ int main()
BOOST_TEST_EQ(r, 0);
}
#ifndef BOOST_LEAF_NO_CXX11_REF_QUALIFIERS
{
auto r = []() -> test_res<int, test_error>
{
BOOST_LEAF_AUTO(v, ([]() -> test_res<int, test_error> { return test_error(42); }()));
return v;
}();
BOOST_TEST(!r);
BOOST_TEST(r.error().moved);
BOOST_TEST_EQ(r.error().value, 42);
}
#endif
return boost::report_errors();
}