Skip to content

Commit

Permalink
Omit tests for assignment of unexpected[_type] with std::unexcepted (#66
Browse files Browse the repository at this point in the history
)
  • Loading branch information
martinmoene committed Jun 4, 2024
1 parent e4f3808 commit 5fd5b70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/expected.t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,26 +276,35 @@ CASE( "unexpected_type: Allows to move-construct from unexpected_type, non-expli

CASE( "unexpected_type: Allows to copy-assign from unexpected_type, default" )
{
#if !nsel_USES_STD_EXPECTED
unexpected_type<int> a{ 7 };
unexpected_type<int> b{ 0 };

b = a;

EXPECT( b.error() == 7 );
#else
EXPECT( !!"no assignment for std::unexpected (C++23)." );
#endif
}

CASE( "unexpected_type: Allows to move-assign from unexpected_type, default" )
{
#if !nsel_USES_STD_EXPECTED
unexpected_type<int> a{ 7 };
unexpected_type<int> b{ 0 };

b = std::move( a );

EXPECT( b.error() == 7 );
#else
EXPECT( !!"no assignment for std::unexpected (C++23)." );
#endif
}

CASE( "unexpected_type: Allows to copy-assign from unexpected_type, converting" )
{
#if !nsel_USES_STD_EXPECTED
unexpected_type<int> u{ 7 };
unexpected_type<Explicit> ue{ 0 };
unexpected_type<Implicit> ui{ 0 };
Expand All @@ -305,6 +314,9 @@ CASE( "unexpected_type: Allows to copy-assign from unexpected_type, converting"

EXPECT( ue.error() == Explicit{7} );
EXPECT( ui.error() == Implicit{7} );
#else
EXPECT( !!"no assignment for std::unexpected (C++23)." );
#endif
}

CASE( "unexpected_type: Allows to move-assign from unexpected, converting" )
Expand Down

0 comments on commit 5fd5b70

Please sign in to comment.