Differences From Artifact [4115eec41d]:
- File
tests/OFStringTests.m
— part of check-in
[80ac05eb8f]
at
2017-11-14 23:19:06
on branch trunk
— Improve -[stringByAppendingPathComponent:]
This now prevents double slashes / backslashes. (user: js, size: 35543) [annotate] [blame] [check-ins using]
To Artifact [da8182eef0]:
- File tests/OFStringTests.m — part of check-in [ad18d4f976] at 2017-11-14 23:27:31 on branch trunk — Add -[OFString stringByAppendingURLPathComponent:] (user: js, size: 36002) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
557 558 559 560 561 562 563 564 565 566 567 568 569 570 | [s[1] appendString: OF_PATH_DELIMITER_STRING]; is = [stringClass stringWithString: s[1]]; [s[1] appendString: @"baz"]; TEST(@"-[stringByAppendingPathComponent:]", [[s[0] stringByAppendingPathComponent: @"baz"] isEqual: s[1]] && [[is stringByAppendingPathComponent: @"baz"] isEqual: s[1]]) TEST(@"-[hasPrefix:]", [C(@"foobar") hasPrefix: @"foo"] && ![C(@"foobar") hasPrefix: @"foobar0"]) TEST(@"-[hasSuffix:]", [C(@"foobar") hasSuffix: @"bar"] && ![C(@"foobar") hasSuffix: @"foobar0"]) i = 0; | > > > > > > > > > > > | 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 | [s[1] appendString: OF_PATH_DELIMITER_STRING]; is = [stringClass stringWithString: s[1]]; [s[1] appendString: @"baz"]; TEST(@"-[stringByAppendingPathComponent:]", [[s[0] stringByAppendingPathComponent: @"baz"] isEqual: s[1]] && [[is stringByAppendingPathComponent: @"baz"] isEqual: s[1]]) s[0] = [mutableStringClass stringWithString: @"foo"]; [s[0] appendString: @"/"]; [s[0] appendString: @"bar"]; s[1] = [mutableStringClass stringWithString: s[0]]; [s[1] appendString: @"/"]; is = [stringClass stringWithString: s[1]]; [s[1] appendString: @"baz"]; TEST(@"-[stringByAppendingURLPathComponent:]", [[s[0] stringByAppendingURLPathComponent: @"baz"] isEqual: s[1]] && [[is stringByAppendingURLPathComponent: @"baz"] isEqual: s[1]]) TEST(@"-[hasPrefix:]", [C(@"foobar") hasPrefix: @"foo"] && ![C(@"foobar") hasPrefix: @"foobar0"]) TEST(@"-[hasSuffix:]", [C(@"foobar") hasSuffix: @"bar"] && ![C(@"foobar") hasSuffix: @"foobar0"]) i = 0; |
︙ | ︙ |