new: unittest for replaceOccurrencesOfString:withString:options:range:

This commit is contained in:
daboe01
2020-07-02 19:38:34 +02:00
parent 77fe16faec
commit 8f5bde2797
+11
View File
@@ -629,6 +629,17 @@ var sharedObject = [CPObject new];
[self assertTrue:[[self stringForTesting] isEqual:string] message:"setAttributedString should have made strings equal, but they were not"];
}
- (void)testReplaceAttributedString
{
var string = [[CPMutableAttributedString alloc] initWithString:"HELLO <br> THERE"];
[string replaceOccurrencesOfString:"<br>"
withString:"<tr>"
options:0
range:nil]
[self assertTrue:[string isEqual:"HELLO <tr> THERE"] message:"replaceOccurrencesOfString:withString:options:range: did not properly replace the search string with the replacement string"];
}
- (void)testEncoding
{
// We can't test using [self stringForTesting] because it contains attributes without coding support.