mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 12:55:40 +02:00
Added initial built-in matchers for NSString (ObjC)
This commit is contained in:
@@ -32,7 +32,7 @@ TEST_CASE( "selftest/main", "Runs all Catch self tests and checks their results"
|
||||
MetaTestRunner::runMatching( "./succeeding/*", MetaTestRunner::Expected::ToSucceed );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
SECTION( "selftest/test counts",
|
||||
"Number of test cases that run is fixed" )
|
||||
|
@@ -42,4 +42,12 @@ OC_TEST_CASE( "OCTest/test2", "This is another test case" )
|
||||
REQUIRE( obj.int_val == 2 );
|
||||
}
|
||||
|
||||
using namespace Catch::Matchers;
|
||||
OC_TEST_CASE( "OCTest/matchers", "Matches work with OC types (NSString so far)" )
|
||||
{
|
||||
REQUIRE_THAT( @"This is a string", Contains( @"is a" ) );
|
||||
REQUIRE_THAT( @"This is a string", StartsWith( @"This" ) );
|
||||
REQUIRE_THAT( @"This is a string", EndsWith( @"string" ) );
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user