Differences From Artifact [fbc369ef09]:
- File
tests/OFStringTests.m
— part of check-in
[4d892e0db1]
at
2013-07-04 20:49:52
on branch trunk
— Fix -[replaceCharactersInRange:withString:].
The resizing is now done before the memmove() if the new string is
bigger and after the memmove() if the new string is shorter. The added
comment explains why this is necessary.This also adds a test for -[replaceCharactersInRange:withString:] that
makes the string bigger and another one that makes it smaller again. (user: js, size: 23140) [annotate] [blame] [check-ins using]
To Artifact [a5ba78df50]:
- File
tests/OFStringTests.m
— part of check-in
[7c4179ab9b]
at
2013-08-14 19:17:10
on branch trunk
— +[stringWithPath:] -> +[pathWithComponents:].
This removes -[initWithPath:,...], so that it's finally possible to use
-[initWithPath:] for many places where a workaround like
-[initWithDirectoryPath:] was required before. (user: js, size: 23218) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
278 279 280 281 282 283 284 | 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"]) | | > | | > | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | 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(@"+[pathWithComponents:]", (is = [OFString pathWithComponents: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]]) && #ifndef _WIN32 [is isEqual: @"foo/bar/baz"] && #else [is isEqual: @"foo\\bar\\baz"] && #endif (is = [OFString pathWithComponents: [OFArray arrayWithObjects: @"foo", nil]]) && [is isEqual: @"foo"]) TEST(@"-[pathComponents]", /* /tmp */ (a = [@"/tmp" pathComponents]) && [a count] == 2 && [[a objectAtIndex: 0] isEqual: @""] && [[a objectAtIndex: 1] isEqual: @"tmp"] && |
︙ | ︙ |