mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 23:36:11 +01:00
Some clean-ups for string handling in Objective-C
This commit is contained in:
parent
f4f4fec5f0
commit
006aafd982
@ -125,7 +125,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string toString() const {
|
virtual std::string toString() const {
|
||||||
return "equals string: \"" + Catch::toString( m_substr ) + "\"";
|
return "equals string: " + Catch::toString( m_substr );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string toString() const {
|
virtual std::string toString() const {
|
||||||
return "contains string: \"" + Catch::toString( m_substr ) + "\"";
|
return "contains string: " + Catch::toString( m_substr );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string toString() const {
|
virtual std::string toString() const {
|
||||||
return "starts with: \"" + Catch::toString( m_substr ) + "\"";
|
return "starts with: " + Catch::toString( m_substr );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct EndsWith : StringHolder<EndsWith> {
|
struct EndsWith : StringHolder<EndsWith> {
|
||||||
@ -163,7 +163,7 @@ namespace Catch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual std::string toString() const {
|
virtual std::string toString() const {
|
||||||
return "ends with: \"" + Catch::toString( m_substr ) + "\"";
|
return "ends with: " + Catch::toString( m_substr );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -146,12 +146,12 @@ std::string toString( std::nullptr_t ) {
|
|||||||
std::string toString( NSString const * const& nsstring ) {
|
std::string toString( NSString const * const& nsstring ) {
|
||||||
if( !nsstring )
|
if( !nsstring )
|
||||||
return "nil";
|
return "nil";
|
||||||
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
return "@" + toString([nsstring UTF8String]);
|
||||||
}
|
}
|
||||||
std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
|
std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
|
||||||
if( !nsstring )
|
if( !nsstring )
|
||||||
return "nil";
|
return "nil";
|
||||||
return std::string( "@\"" ) + [nsstring UTF8String] + "\"";
|
return "@" + toString([nsstring UTF8String]);
|
||||||
}
|
}
|
||||||
std::string toString( NSObject* const& nsObject ) {
|
std::string toString( NSObject* const& nsObject ) {
|
||||||
return toString( [nsObject description] );
|
return toString( [nsObject description] );
|
||||||
|
Loading…
Reference in New Issue
Block a user