mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Fixed a == 1 || b == 2 case
This commit is contained in:
parent
e3bcf68f7a
commit
3d0fed768a
@ -24,7 +24,7 @@ namespace Catch
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE( "succeeding/Tricky", "Some tricky to parse tests" )
|
TEST_CASE( "succeeding/Tricky/std::pair", "Parsing a std::pair" )
|
||||||
{
|
{
|
||||||
std::pair<int, int> aNicePair( 1, 2 );
|
std::pair<int, int> aNicePair( 1, 2 );
|
||||||
|
|
||||||
@ -32,3 +32,12 @@ TEST_CASE( "succeeding/Tricky", "Some tricky to parse tests" )
|
|||||||
EXPECT( (std::pair<int, int>( 1, 2 )) == aNicePair );
|
EXPECT( (std::pair<int, int>( 1, 2 )) == aNicePair );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE( "succeeding/Tricky/complex lhs", "Where the LHS is not a simple value" )
|
||||||
|
{
|
||||||
|
int a = 1;
|
||||||
|
int b = 2;
|
||||||
|
|
||||||
|
// !TBD: This only captures part of the expression
|
||||||
|
EXPECT( a == 2 || b == 2 );
|
||||||
|
}
|
@ -60,6 +60,14 @@ public:
|
|||||||
m_message = message;
|
m_message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename RhsT>
|
||||||
|
MutableResultInfo& operator ||( const RhsT& rhs )
|
||||||
|
{
|
||||||
|
// !TBD: set message to say we haven't captured all parts
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class ResultBuilder;
|
friend class ResultBuilder;
|
||||||
void setLhs( const std::string& lhs )
|
void setLhs( const std::string& lhs )
|
||||||
@ -118,6 +126,7 @@ public:
|
|||||||
{
|
{
|
||||||
return m_result.setRhs( ">=", toString( rhs ) );
|
return m_result.setRhs( ">=", toString( rhs ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
operator MutableResultInfo&()
|
operator MutableResultInfo&()
|
||||||
{
|
{
|
||||||
return m_result;
|
return m_result;
|
||||||
|
Loading…
Reference in New Issue
Block a user