From 82ef0886bf89339bfe7a1855e697e61959eeb486 Mon Sep 17 00:00:00 2001 From: rsgowman Date: Wed, 11 Jul 2018 21:59:49 -0400 Subject: Move creation of FSTFilter objects to static create method on FSTFilter. (#1512) Rather than previously inlining it in the calling code. This is to unify filter creation across platforms. (This change involves altering FSTFilter from a protocol to an abstract class.) --- Firestore/Example/Tests/Core/FSTQueryTests.mm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Firestore/Example/Tests/Core') diff --git a/Firestore/Example/Tests/Core/FSTQueryTests.mm b/Firestore/Example/Tests/Core/FSTQueryTests.mm index 6118d0f..362a94c 100644 --- a/Firestore/Example/Tests/Core/FSTQueryTests.mm +++ b/Firestore/Example/Tests/Core/FSTQueryTests.mm @@ -287,20 +287,19 @@ NS_ASSUME_NONNULL_BEGIN FSTQuery *baseQuery = FSTTestQuery("collection"); FSTDocument *doc1 = FSTTestDoc("collection/doc", 0, @{ @"tags" : @[ @"foo", @1, @YES ] }, NO); - NSArray> *matchingFilters = - @[ FSTTestFilter("tags", @"==", @[ @"foo", @1, @YES ]) ]; + NSArray *matchingFilters = @[ FSTTestFilter("tags", @"==", @[ @"foo", @1, @YES ]) ]; - NSArray> *nonMatchingFilters = @[ + NSArray *nonMatchingFilters = @[ FSTTestFilter("tags", @"==", @"foo"), FSTTestFilter("tags", @"==", @[ @"foo", @1 ]), FSTTestFilter("tags", @"==", @[ @"foo", @YES, @1 ]), ]; - for (id filter in matchingFilters) { + for (FSTFilter *filter in matchingFilters) { XCTAssertTrue([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]); } - for (id filter in nonMatchingFilters) { + for (FSTFilter *filter in nonMatchingFilters) { XCTAssertFalse([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]); } } @@ -311,7 +310,7 @@ NS_ASSUME_NONNULL_BEGIN FSTTestDoc("collection/doc", 0, @{ @"tags" : @{@"foo" : @"foo", @"a" : @0, @"b" : @YES, @"c" : @(NAN)} }, NO); - NSArray> *matchingFilters = @[ + NSArray *matchingFilters = @[ FSTTestFilter("tags", @"==", @{ @"foo" : @"foo", @"a" : @0, @@ -325,7 +324,7 @@ NS_ASSUME_NONNULL_BEGIN FSTTestFilter("tags.foo", @"==", @"foo") ]; - NSArray> *nonMatchingFilters = @[ + NSArray *nonMatchingFilters = @[ FSTTestFilter("tags", @"==", @"foo"), FSTTestFilter("tags", @"==", @{ @"foo" : @"foo", @"a" : @0, @@ -333,11 +332,11 @@ NS_ASSUME_NONNULL_BEGIN }) ]; - for (id filter in matchingFilters) { + for (FSTFilter *filter in matchingFilters) { XCTAssertTrue([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]); } - for (id filter in nonMatchingFilters) { + for (FSTFilter *filter in nonMatchingFilters) { XCTAssertFalse([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]); } } -- cgit v1.2.3