Index: tests/OFStringTests.m ================================================================== --- tests/OFStringTests.m +++ tests/OFStringTests.m @@ -73,10 +73,13 @@ OFMutableString *s[3]; OFArray *a; int i; of_unichar_t *ua; 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]; @@ -508,10 +511,36 @@ if ([entity isEqual: @"foo"]) return @"bar"; return nil; }] isEqual: @"xbary"]) + + ok = YES; + [@"foo\nbar\nbaz" enumerateLinesUsingBlock: + ^ (OFString *line, BOOL *stop) { + static int i = 0; + + switch (i) { + case 0: + if (![line isEqual: @"foo"]) + ok = NO; + break; + case 1: + if (![line isEqual: @"bar"]) + ok = NO; + break; + case 2: + if (![line isEqual: @"baz"]) + ok = NO; + break; + default: + ok = NO; + } + + i++; + }]; + TEST(@"-[enumerateLinesUsingBlock:]", ok) #endif [pool drain]; } @end