From ce2316a8ee9507c108232af7df2d5d006a8f1cbc Mon Sep 17 00:00:00 2001 From: cacaodev Date: Sat, 31 Dec 2011 16:19:38 +0100 Subject: [PATCH] CPCompoundPredicate: Fixed typo in -isEqual:. With test. --- Foundation/CPPredicate/CPCompoundPredicate.j | 2 +- Tests/Foundation/CPPredicateTest.j | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Foundation/CPPredicate/CPCompoundPredicate.j b/Foundation/CPPredicate/CPCompoundPredicate.j index e9b381e95..c4b94b4ad 100644 --- a/Foundation/CPPredicate/CPCompoundPredicate.j +++ b/Foundation/CPPredicate/CPCompoundPredicate.j @@ -233,7 +233,7 @@ var CPCompoundPredicateType; if (self === anObject) return YES; - if (object.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]]) + if (anObject.isa !== self.isa || _type !== [anObject compoundPredicateType] || ![_predicates isEqualToArray:[anObject subpredicates]]) return NO; return YES; diff --git a/Tests/Foundation/CPPredicateTest.j b/Tests/Foundation/CPPredicateTest.j index cb587f156..3001b08cb 100644 --- a/Tests/Foundation/CPPredicateTest.j +++ b/Tests/Foundation/CPPredicateTest.j @@ -434,6 +434,10 @@ pred1 = [CPPredicate predicateWithFormat:@"$x CONTAINS 'a'"]; pred2 = [CPPredicate predicateWithFormat:@"$x CONTAINS 'a'"]; [self assert:pred1 equals:pred2]; + + pred1 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"]; + pred2 = [CPPredicate predicateWithFormat:@"a = 'a' AND b = 'b'"]; + [self assert:pred1 equals:pred2]; } - (void)testProxyArrayFiltering