Differences From Artifact [8d7d5918e5]:
- File tests/OFStringTests.m — part of check-in [f38744df74] at 2012-10-14 00:59:55 on branch trunk — OF_INVALID_INDEX -> OF_NOT_FOUND. (user: js, size: 22244) [annotate] [blame] [check-ins using]
To Artifact [7769c4140e]:
- File
tests/OFStringTests.m
— part of check-in
[fcaa549324]
at
2012-10-16 14:47:55
on branch trunk
— A few more API improvements.
This should make it more future-proof, as adding new options is easier
than adding new methods for each and every combination of options. (user: js, size: 22277) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
265 266 267 268 269 270 271 | [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"baz"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""]) i = 0; | | | > | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"baz"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""]) i = 0; TEST(@"-[componentsSeparatedByString:options:]", (a = [@"fooXXbarXXXXbazXXXX" componentsSeparatedByString: @"XX" options: OF_STRING_SKIP_EMPTY]) && [a count] == 3 && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"]) TEST(@"+[stringWithPath:]", (is = [OFString stringWithPath: @"foo", @"bar", @"baz", nil]) && |
︙ | ︙ | |||
497 498 499 500 501 502 503 | withString: @"foo"]) && [s[0] isEqual: @"asd foo asd foofoo asd"] && (s[0] = [OFMutableString stringWithString: @"XX"]) && R([s[0] replaceOccurrencesOfString: @"X" withString: @"XX"]) && [s[0] isEqual: @"XXXX"]) | | > | | 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | withString: @"foo"]) && [s[0] isEqual: @"asd foo asd foofoo asd"] && (s[0] = [OFMutableString stringWithString: @"XX"]) && R([s[0] replaceOccurrencesOfString: @"X" withString: @"XX"]) && [s[0] isEqual: @"XXXX"]) TEST(@"-[replaceOccurrencesOfString:withString:options:range:]", (s[0] = [OFMutableString stringWithString: @"foofoobarfoobarfoo"]) && R([s[0] replaceOccurrencesOfString: @"oo" withString: @"óò" options: 0 range: of_range(2, 15)]) && [s[0] isEqual: @"foofóòbarfóòbarfoo"]) TEST(@"-[deleteLeadingWhitespaces]", (s[0] = [OFMutableString stringWithString: whitespace[0]]) && R([s[0] deleteLeadingWhitespaces]) && [s[0] isEqual: @"asd \t \t\t\r\n"] && (s[0] = [OFMutableString stringWithString: whitespace[1]]) && |
︙ | ︙ |