Differences From Artifact [61ef4cadec]:
- File tests/OFStringTests.m — part of check-in [beb9051a10] at 2013-01-11 12:13:38 on branch trunk — Add -[OFMutableString appendCharacters:length:]. (user: js, size: 23011) [annotate] [blame] [check-ins using]
To Artifact [5f1c00ddf1]:
- File
tests/OFStringTests.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 23025) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
76 77 78 79 80 81 82 | OFString *is; OFArray *a; int i; const of_unichar_t *ua; const uint16_t *u16a; EntityHandler *h; #ifdef OF_HAVE_BLOCKS | | | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | OFString *is; OFArray *a; int i; const of_unichar_t *ua; const uint16_t *u16a; EntityHandler *h; #ifdef OF_HAVE_BLOCKS __block bool ok; #endif s[0] = [OFMutableString stringWithString: @"täs€"]; s[1] = [OFMutableString string]; s[2] = [[s[0] copy] autorelease]; TEST(@"-[isEqual:]", [s[0] isEqual: s[2]] && |
︙ | ︙ | |||
105 106 107 108 109 110 111 | [@"я" caseInsensitiveCompare: @"Я"] == OF_ORDERED_SAME && [@"€" caseInsensitiveCompare: @"ß"] == OF_ORDERED_DESCENDING && [@"ß" caseInsensitiveCompare: @"→"] == OF_ORDERED_ASCENDING && [@"AA" caseInsensitiveCompare: @"z"] == OF_ORDERED_ASCENDING && [[OFString stringWithUTF8String: "ABC"] caseInsensitiveCompare: [OFString stringWithUTF8String: "AbD"]] == [@"abc" compare: @"abd"]) | | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | [@"я" caseInsensitiveCompare: @"Я"] == OF_ORDERED_SAME && [@"€" caseInsensitiveCompare: @"ß"] == OF_ORDERED_DESCENDING && [@"ß" caseInsensitiveCompare: @"→"] == OF_ORDERED_ASCENDING && [@"AA" caseInsensitiveCompare: @"z"] == OF_ORDERED_ASCENDING && [[OFString stringWithUTF8String: "ABC"] caseInsensitiveCompare: [OFString stringWithUTF8String: "AbD"]] == [@"abc" compare: @"abd"]) TEST(@"-[hash] is the same if -[isEqual:] is true", [s[0] hash] == [s[2] hash]) TEST(@"-[description]", [[s[0] description] isEqual: s[0]]) TEST(@"-[appendString:] and -[appendUTF8String:]", R([s[1] appendUTF8String: "1𝄞"]) && R([s[1] appendString: @"3"]) && R([s[0] appendString: s[1]]) && [s[0] isEqual: @"täs€1𝄞3"]) |
︙ | ︙ | |||
585 586 587 588 589 590 591 | ^ OFString* (OFString *str, OFString *entity) { if ([entity isEqual: @"foo"]) return @"bar"; return nil; }] isEqual: @"xbary"]) | | | | | | | | 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | ^ OFString* (OFString *str, OFString *entity) { if ([entity isEqual: @"foo"]) return @"bar"; return nil; }] isEqual: @"xbary"]) ok = true; [@"foo\nbar\nbaz" enumerateLinesUsingBlock: ^ (OFString *line, bool *stop) { static int i = 0; switch (i) { case 0: if (![line isEqual: @"foo"]) ok = false; break; case 1: if (![line isEqual: @"bar"]) ok = false; break; case 2: if (![line isEqual: @"baz"]) ok = false; break; default: ok = false; } i++; }]; TEST(@"-[enumerateLinesUsingBlock:]", ok) #endif [pool drain]; } @end |