mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-01 06:37:41 +00:00
test whether range restriction works
This commit is contained in:
@@ -640,6 +640,18 @@ var sharedObject = [CPObject new];
|
||||
[self assertTrue:[string._string isEqual:"HELLO <tr> 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 <br> THERE"];
|
||||
[string replaceOccurrencesOfString:"<br>"
|
||||
withString:"<tr>"
|
||||
options:0
|
||||
range:CPMakeRange(0, 4)];
|
||||
|
||||
[self assertTrue:[string._string isEqual:"HELLO <br> 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.
|
||||
|
||||
Reference in New Issue
Block a user