ObjFW  Diff

Differences From Artifact [8f7079d7f6]:

To Artifact [3eba69945b]:


71
72
73
74
75
76
77



78
79
80
81
82
83
84
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFMutableString *s[3];
	OFArray *a;
	int i;
	of_unichar_t *ua;
	EntityHandler *h;




	s[0] = [OFMutableString stringWithString: @"täs€"];
	s[1] = [OFMutableString string];
	s[2] = [[s[0] copy] autorelease];

	TEST(@"-[isEqual:]", [s[0] isEqual: s[2]] &&
	    ![s[0] isEqual: [[[OFObject alloc] init] autorelease]])







>
>
>







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	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];

	TEST(@"-[isEqual:]", [s[0] isEqual: s[2]] &&
	    ![s[0] isEqual: [[[OFObject alloc] init] autorelease]])
506
507
508
509
510
511
512


























513
514
515
516
517
	    [[@"x&foo;y" stringByXMLUnescapingWithBlock:
	        ^ OFString* (OFString *str, OFString *entity) {
		    if ([entity isEqual: @"foo"])
			    return @"bar";

		    return nil;
	    }] isEqual: @"xbary"])


























#endif

	[pool drain];
}
@end







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
	    [[@"x&foo;y" stringByXMLUnescapingWithBlock:
	        ^ OFString* (OFString *str, OFString *entity) {
		    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