diff --git a/Tests/Foundation/CPAttributedStringTest.j b/Tests/Foundation/CPAttributedStringTest.j index 2dab05e28..07061b958 100644 --- a/Tests/Foundation/CPAttributedStringTest.j +++ b/Tests/Foundation/CPAttributedStringTest.j @@ -640,6 +640,18 @@ var sharedObject = [CPObject new]; [self assertTrue:[string._string isEqual:"HELLO THERE"] message:"replaceOccurrencesOfString:withString:options:range: did not properly replace the search string with the replacement string. Result is: " + string._string]; } +- (void)testReplaceAttributedStringWithRange +{ + var string = [[CPMutableAttributedString alloc] initWithString:"HELLO
THERE"]; + [string replaceOccurrencesOfString:"
" + withString:"" + options:0 + range:CPMakeRange(0, 4)]; + + [self assertTrue:[string._string isEqual:"HELLO
THERE"] message:"replaceOccurrencesOfString:withString:options:range: did not respect the range restriction. Result is: " + string._string]; +} + + - (void)testEncoding { // We can't test using [self stringForTesting] because it contains attributes without coding support.