mirror of
https://github.com/boostorg/leaf.git
synced 2026-02-22 15:32:24 +00:00
Issue 89
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user