mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 05:15:39 +02:00
More Single Evaluation work
This commit is contained in:
@@ -20,7 +20,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results"
|
||||
|
||||
runner.runMatching( "./succeeding/*" );
|
||||
INFO( runner.getOutput() );
|
||||
CHECK( runner.getSuccessCount() == 212 );
|
||||
CHECK( runner.getSuccessCount() == 213 );
|
||||
CHECK( runner.getFailureCount() == 0 );
|
||||
|
||||
runner.runMatching( "./failing/*" );
|
||||
|
@@ -24,7 +24,12 @@ namespace Catch
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE( "./succeeding/Tricky/std::pair", "Parsing a std::pair" )
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
TEST_CASE
|
||||
(
|
||||
"./succeeding/Tricky/std::pair",
|
||||
"Parsing a std::pair"
|
||||
)
|
||||
{
|
||||
std::pair<int, int> aNicePair( 1, 2 );
|
||||
|
||||
@@ -33,7 +38,12 @@ TEST_CASE( "./succeeding/Tricky/std::pair", "Parsing a std::pair" )
|
||||
|
||||
}
|
||||
|
||||
TEST_CASE( "./succeeding/Tricky/complex lhs", "Where the LHS is not a simple value" )
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
TEST_CASE
|
||||
(
|
||||
"./inprogress/succeeding/Tricky/complex lhs",
|
||||
"Where the LHS is not a simple value"
|
||||
)
|
||||
{
|
||||
int a = 1;
|
||||
int b = 2;
|
||||
@@ -45,13 +55,18 @@ TEST_CASE( "./succeeding/Tricky/complex lhs", "Where the LHS is not a simple val
|
||||
struct Opaque
|
||||
{
|
||||
int val;
|
||||
bool operator ==( const Opaque& o )
|
||||
bool operator ==( const Opaque& o ) const
|
||||
{
|
||||
return val == o.val;
|
||||
}
|
||||
};
|
||||
|
||||
TEST_CASE( "./failing/Tricky/non streamable type", "A failing expression with a non streamable type is still captured" )
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
TEST_CASE
|
||||
(
|
||||
"./failing/Tricky/non streamable type",
|
||||
"A failing expression with a non streamable type is still captured"
|
||||
)
|
||||
{
|
||||
|
||||
Opaque o1, o2;
|
||||
@@ -61,3 +76,28 @@ TEST_CASE( "./failing/Tricky/non streamable type", "A failing expression with a
|
||||
CHECK( &o1 == &o2 );
|
||||
CHECK( o1 == o2 );
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
TEST_CASE
|
||||
(
|
||||
"./failing/string literals",
|
||||
"string literals of different sizes can be compared"
|
||||
)
|
||||
{
|
||||
REQUIRE( std::string( "first" ) == "second" );
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
TEST_CASE
|
||||
(
|
||||
"./succeeding/side-effects",
|
||||
"An expression with side-effects should only be evaluated once"
|
||||
)
|
||||
{
|
||||
int i = 7;
|
||||
|
||||
REQUIRE( i++ == 7 );
|
||||
REQUIRE( i++ == 8 );
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user