Replace dot notation with method call

This commit is contained in:
hmelder 2023-12-10 19:51:47 +01:00 committed by Hugo Melder
parent 153fe3f7f0
commit 992377c6fd

View file

@ -21,19 +21,19 @@ int main(void) {
value = [[filtered objectAtIndex:0] objectForKey:@"key"]; value = [[filtered objectAtIndex:0] objectForKey:@"key"];
PASS(filtered.count == 1 && [value isEqualToString:@"value2"], PASS([filtered count] == 1 && [value isEqualToString:@"value2"],
"NSPredicate should correctly filter array including NSNull"); "NSPredicate should correctly filter array including NSNull");
// Filtering with NSPredicate where no match is found // Filtering with NSPredicate where no match is found
predicate = [NSPredicate predicateWithFormat:@"key == %@", @"nonexistent"]; predicate = [NSPredicate predicateWithFormat:@"key == %@", @"nonexistent"];
filtered = [array filteredArrayUsingPredicate: predicate]; filtered = [array filteredArrayUsingPredicate: predicate];
PASS(filtered.count == 0, PASS([filtered count] == 0,
"NSPredicate should return an empty array when no match is found"); "NSPredicate should return an empty array when no match is found");
// Filtering with NSPredicate with a different key // Filtering with NSPredicate with a different key
predicate = [NSPredicate predicateWithFormat:@"anotherKey == %@", @"value1"]; predicate = [NSPredicate predicateWithFormat:@"anotherKey == %@", @"value1"];
filtered = [array filteredArrayUsingPredicate: predicate]; filtered = [array filteredArrayUsingPredicate: predicate];
PASS(filtered.count == 0, PASS([filtered count] == 0,
"NSPredicate should return an empty array when filtering with a non-existent key"); "NSPredicate should return an empty array when filtering with a non-existent key");
[arp release]; [arp release];