Differences From Artifact [9c3fe0a3f0]:
- File
tests/OFStringTests.m
— part of check-in
[5831626f68]
at
2018-05-13 19:24:28
on branch trunk
— platform.h: Rename OF_AMIGAOS3 to OF_AMIGAOS_M68K
The reason for this is that, in theory, this also supports versions
older than 3. (user: js, size: 43925) [annotate] [blame] [check-ins using]
To Artifact [9cd5a66eea]:
- File tests/OFStringTests.m — part of check-in [8939d24b51] at 2018-07-07 21:37:55 on branch trunk — Add -[componentsSeparatedByCharactersInSet:] (user: js, size: 45047) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
220 221 222 223 224 225 226 | - (void)stringTestsWithClass: (Class)stringClass mutableClass: (Class)mutableStringClass { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMutableString *s[3]; OFString *is; OFArray *a; | | | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - (void)stringTestsWithClass: (Class)stringClass mutableClass: (Class)mutableStringClass { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFMutableString *s[3]; OFString *is; OFArray *a; size_t i; const of_unichar_t *ua; const uint16_t *u16a; OFCharacterSet *cs; EntityHandler *h; #ifdef OF_HAVE_BLOCKS __block int j; __block bool ok; |
︙ | ︙ | |||
602 603 604 605 606 607 608 | TEST(@"-[hasSuffix:]", [C(@"foobar") hasSuffix: @"bar"] && ![C(@"foobar") hasSuffix: @"foobar0"]) i = 0; TEST(@"-[componentsSeparatedByString:]", (a = [C(@"fooXXbarXXXXbazXXXX") | | | > > > > | > > > > > > > > | > > > > > > > > > > > > > > > > > > | 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | TEST(@"-[hasSuffix:]", [C(@"foobar") hasSuffix: @"bar"] && ![C(@"foobar") hasSuffix: @"foobar0"]) i = 0; TEST(@"-[componentsSeparatedByString:]", (a = [C(@"fooXXbarXXXXbazXXXX") componentsSeparatedByString: @"XX"]) && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"baz"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""] && [a count] == i) i = 0; TEST(@"-[componentsSeparatedByString:options:]", (a = [C(@"fooXXbarXXXXbazXXXX") componentsSeparatedByString: @"XX" options: OF_STRING_SKIP_EMPTY]) && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"] && [a count] == i) cs = [OFCharacterSet characterSetWithCharactersInString: @"XYZ"]; i = 0; TEST(@"-[componentsSeparatedByCharactersInSet:]", (a = [C(@"fooXYbarXYZXbazXYXZx") componentsSeparatedByCharactersInSet: cs]) && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"baz"] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @""] && [[a objectAtIndex: i++] isEqual: @"x"] && [a count] == i) i = 0; TEST(@"-[componentsSeparatedByCharactersInSet:options:]", (a = [C(@"fooXYbarXYZXbazXYXZ") componentsSeparatedByCharactersInSet: cs options: OF_STRING_SKIP_EMPTY]) && [[a objectAtIndex: i++] isEqual: @"foo"] && [[a objectAtIndex: i++] isEqual: @"bar"] && [[a objectAtIndex: i++] isEqual: @"baz"] && [a count] == i) #ifdef OF_HAVE_FILES # if defined(OF_WINDOWS) || defined(OF_MSDOS) TEST(@"+[pathWithComponents:]", [[stringClass pathWithComponents: [OFArray arrayWithObjects: @"foo", @"bar", @"baz", nil]] isEqual: @"foo\\bar\\baz"] && [[stringClass pathWithComponents: [OFArray arrayWithObjects: |
︙ | ︙ |