git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39779 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-05-19 07:21:36 +00:00
parent 544a43092e
commit 8a9d9597b0
2 changed files with 18 additions and 3 deletions

View file

@ -1476,7 +1476,7 @@ compare(id elem1, id elem2, void* context)
else if ([key isEqualToString: @"count"] == YES)
{
GSOnceMLog(
@"[NSArray-valueForKey:] called wth 'count' is deprecated .. use '@count'");
@"[NSArray-valueForKey:] called with 'count' is deprecated .. use '@count'");
result = [NSNumber numberWithUnsignedInteger: [self count]];
}
else

View file

@ -149,10 +149,12 @@ int main()
NSArray *filtered;
NSArray *pitches;
NSArray *expect;
NSArray *a;
NSMutableDictionary *dict;
NSPredicate *p;
NSDictionary *d;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
START_SET("basic")
dict = [[NSMutableDictionary alloc] init];
[dict setObject: @"A Title" forKey: @"title"];
@ -227,6 +229,19 @@ int main()
@"$single LIKE (\"b\\\"\" + \"val_for_$b\") + \"val_for_$c\"",
"Predicate created by substitution has the expected format");
[arp release]; arp = nil;
a = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: 1], @"count", nil],
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt: 1], @"count", nil],
nil];
p = [NSPredicate predicateWithFormat: @"sum(@count) == 2"];
PASS([p evaluateWithObject: a], "aggregate sum works");
p = [NSPredicate predicateWithFormat: @"avg(@count) == 1"];
PASS([p evaluateWithObject: a], "aggregate avg works");
END_SET("basic")
return 0;
}