mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
Don't introduce Catch::Matchers namespace in macro
- this could be a breaking change - fixed up self-test code to compensate
This commit is contained in:
parent
315c83ad87
commit
f3e7722cc6
@ -131,12 +131,12 @@
|
|||||||
do { \
|
do { \
|
||||||
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \
|
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg " " #matcher, resultDisposition ); \
|
||||||
try { \
|
try { \
|
||||||
std::string matcherAsString = ::Catch::Matchers::matcher.toString(); \
|
std::string matcherAsString = (matcher).toString(); \
|
||||||
__catchResult \
|
__catchResult \
|
||||||
.setLhs( Catch::toString( arg ) ) \
|
.setLhs( Catch::toString( arg ) ) \
|
||||||
.setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \
|
.setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \
|
||||||
.setOp( "matches" ) \
|
.setOp( "matches" ) \
|
||||||
.setResultType( ::Catch::Matchers::matcher.match( arg ) ); \
|
.setResultType( (matcher).match( arg ) ); \
|
||||||
__catchResult.captureExpression(); \
|
__catchResult.captureExpression(); \
|
||||||
} catch( ... ) { \
|
} catch( ... ) { \
|
||||||
__catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \
|
__catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \
|
||||||
|
@ -208,6 +208,7 @@ inline const char* testStringForMatching()
|
|||||||
{
|
{
|
||||||
return "this string contains 'abc' as a substring";
|
return "this string contains 'abc' as a substring";
|
||||||
}
|
}
|
||||||
|
using namespace Catch::Matchers;
|
||||||
|
|
||||||
TEST_CASE("String matchers", "[matchers]" )
|
TEST_CASE("String matchers", "[matchers]" )
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
TEST_CASE( "Tag alias can be registered against tag patterns", "" ) {
|
TEST_CASE( "Tag alias can be registered against tag patterns", "" ) {
|
||||||
|
|
||||||
|
using namespace Catch::Matchers;
|
||||||
|
|
||||||
Catch::TagAliasRegistry registry;
|
Catch::TagAliasRegistry registry;
|
||||||
|
|
||||||
registry.add( "[@zzz]", "[one][two]", Catch::SourceLineInfo( "file", 2 ) );
|
registry.add( "[@zzz]", "[one][two]", Catch::SourceLineInfo( "file", 2 ) );
|
||||||
|
@ -44,6 +44,8 @@ inline Catch::TestCase fakeTestCase( const char* name, const char* desc = "" ){
|
|||||||
|
|
||||||
TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) {
|
TEST_CASE( "Process can be configured on command line", "[config][command-line]" ) {
|
||||||
|
|
||||||
|
using namespace Catch::Matchers;
|
||||||
|
|
||||||
Catch::ConfigData config;
|
Catch::ConfigData config;
|
||||||
|
|
||||||
SECTION( "default - no arguments", "" ) {
|
SECTION( "default - no arguments", "" ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user