aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Core/FSTQueryTests.mm
diff options
context:
space:
mode:
authorGravatar rsgowman <rgowman@google.com>2018-07-11 21:59:49 -0400
committerGravatar GitHub <noreply@github.com>2018-07-11 21:59:49 -0400
commit82ef0886bf89339bfe7a1855e697e61959eeb486 (patch)
tree67869be000dd249cf088ab899d96b250a16c2ca4 /Firestore/Example/Tests/Core/FSTQueryTests.mm
parent7fc953fc6ffa69d159c0523d3902d867fe8c0ca5 (diff)
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.)
Diffstat (limited to 'Firestore/Example/Tests/Core/FSTQueryTests.mm')
-rw-r--r--Firestore/Example/Tests/Core/FSTQueryTests.mm17
1 files changed, 8 insertions, 9 deletions
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<id<FSTFilter>> *matchingFilters =
- @[ FSTTestFilter("tags", @"==", @[ @"foo", @1, @YES ]) ];
+ NSArray<FSTFilter *> *matchingFilters = @[ FSTTestFilter("tags", @"==", @[ @"foo", @1, @YES ]) ];
- NSArray<id<FSTFilter>> *nonMatchingFilters = @[
+ NSArray<FSTFilter *> *nonMatchingFilters = @[
FSTTestFilter("tags", @"==", @"foo"),
FSTTestFilter("tags", @"==", @[ @"foo", @1 ]),
FSTTestFilter("tags", @"==", @[ @"foo", @YES, @1 ]),
];
- for (id<FSTFilter> filter in matchingFilters) {
+ for (FSTFilter *filter in matchingFilters) {
XCTAssertTrue([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]);
}
- for (id<FSTFilter> 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<id<FSTFilter>> *matchingFilters = @[
+ NSArray<FSTFilter *> *matchingFilters = @[
FSTTestFilter("tags", @"==",
@{ @"foo" : @"foo",
@"a" : @0,
@@ -325,7 +324,7 @@ NS_ASSUME_NONNULL_BEGIN
FSTTestFilter("tags.foo", @"==", @"foo")
];
- NSArray<id<FSTFilter>> *nonMatchingFilters = @[
+ NSArray<FSTFilter *> *nonMatchingFilters = @[
FSTTestFilter("tags", @"==", @"foo"), FSTTestFilter("tags", @"==", @{
@"foo" : @"foo",
@"a" : @0,
@@ -333,11 +332,11 @@ NS_ASSUME_NONNULL_BEGIN
})
];
- for (id<FSTFilter> filter in matchingFilters) {
+ for (FSTFilter *filter in matchingFilters) {
XCTAssertTrue([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]);
}
- for (id<FSTFilter> filter in nonMatchingFilters) {
+ for (FSTFilter *filter in nonMatchingFilters) {
XCTAssertFalse([[baseQuery queryByAddingFilter:filter] matchesDocument:doc1]);
}
}