Add some more test cases exercising result initialization from {}

This commit is contained in:
Peter Dimov
2023-10-20 21:49:20 +03:00
parent eb788615de
commit 61a0e244da
2 changed files with 58 additions and 0 deletions
+12
View File
@@ -69,6 +69,11 @@ result<std::vector<int>> fv2()
return {{ 1, 2 }};
}
result<void> fw0()
{
return {};
}
int main()
{
{
@@ -148,5 +153,12 @@ int main()
BOOST_TEST_EQ( r->at(1), 2 );
}
{
result<void> r = fw0();
BOOST_TEST( r.has_value() );
BOOST_TEST( !r.has_error() );
}
return boost::report_errors();
}