mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Matchers macro uses Catch::Matchers namespace internally - so it doesn't have to be declared with "using" first
This commit is contained in:
		| @@ -247,8 +247,6 @@ inline const char* testStringForMatching() | ||||
|     return "this string contains 'abc' as a substring"; | ||||
| } | ||||
|  | ||||
| using namespace Catch::Matchers; | ||||
|  | ||||
| TEST_CASE("./succeeding/matchers", "")  | ||||
| { | ||||
|     REQUIRE_THAT( testStringForMatching(), Contains( "string" ) );     | ||||
| @@ -272,3 +270,13 @@ TEST_CASE("./failing/matchers/EndsWith", "") | ||||
| { | ||||
|     CHECK_THAT( testStringForMatching(), EndsWith( "this" ) ); | ||||
| } | ||||
|  | ||||
| TEST_CASE("./failing/matchers/Equals", "") | ||||
| { | ||||
|     CHECK_THAT( testStringForMatching(), Equals( "something else" ) ); | ||||
| } | ||||
|  | ||||
| TEST_CASE("./succeeding/matchers/Equals", "") | ||||
| { | ||||
|     CHECK_THAT( testStringForMatching(), Equals( "this string contains 'abc' as a substring" ) ); | ||||
| } | ||||
|   | ||||
| @@ -33,7 +33,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" | ||||
|         SECTION(    "selftest/test counts/succeeding tests",  | ||||
|                     "Number of 'succeeding' tests is fixed" ) { | ||||
|             runner.runMatching( "./succeeding/*" ); | ||||
|             CHECK( runner.getTotals().assertions.passed == 276 ); | ||||
|             CHECK( runner.getTotals().assertions.passed == 277 ); | ||||
|             CHECK( runner.getTotals().assertions.failed == 0 ); | ||||
|         } | ||||
|  | ||||
| @@ -41,7 +41,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results" | ||||
|                     "Number of 'failing' tests is fixed" ) { | ||||
|             runner.runMatching( "./failing/*" );         | ||||
|             CHECK( runner.getTotals().assertions.passed == 0 ); | ||||
|             CHECK( runner.getTotals().assertions.failed == 71 ); | ||||
|             CHECK( runner.getTotals().assertions.failed == 72 ); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -60,7 +60,6 @@ void useObject( const T& object ){} | ||||
| template<typename T> | ||||
| void useObject( const T* object ){} | ||||
|  | ||||
| using namespace Catch::Matchers; | ||||
| OC_TEST_CASE( "OCTest/matchers", "Matches work with OC types (NSString so far)" ) | ||||
| { | ||||
|     REQUIRE_THAT( @"This is a string", Equals( @"This is a string" ) ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash