aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Example/Tests/Util
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Example/Tests/Util')
-rw-r--r--Firestore/Example/Tests/Util/FSTHelpers.h4
-rw-r--r--Firestore/Example/Tests/Util/FSTHelpers.mm13
2 files changed, 5 insertions, 12 deletions
diff --git a/Firestore/Example/Tests/Util/FSTHelpers.h b/Firestore/Example/Tests/Util/FSTHelpers.h
index 7946c06..8e5a86f 100644
--- a/Firestore/Example/Tests/Util/FSTHelpers.h
+++ b/Firestore/Example/Tests/Util/FSTHelpers.h
@@ -34,6 +34,7 @@
@class FSTDocumentKeyReference;
@class FSTDocumentSet;
@class FSTFieldValue;
+@class FSTFilter;
@class FSTLocalViewChanges;
@class FSTPatchMutation;
@class FSTQuery;
@@ -46,7 +47,6 @@
@class FSTView;
@class FSTViewSnapshot;
@class FSTObjectValue;
-@protocol FSTFilter;
NS_ASSUME_NONNULL_BEGIN
@@ -242,7 +242,7 @@ FSTQuery *FSTTestQuery(const absl::string_view path);
* A convenience method to create a FSTFilter using a string representation for both field
* and operator (<, <=, ==, >=, >, array_contains).
*/
-id<FSTFilter> FSTTestFilter(const absl::string_view field, NSString *op, id value);
+FSTFilter *FSTTestFilter(const absl::string_view field, NSString *op, id value);
/** A convenience method for creating sort orders. */
FSTSortOrder *FSTTestOrderBy(const absl::string_view field, NSString *direction);
diff --git a/Firestore/Example/Tests/Util/FSTHelpers.mm b/Firestore/Example/Tests/Util/FSTHelpers.mm
index 8ece82f..58513b0 100644
--- a/Firestore/Example/Tests/Util/FSTHelpers.mm
+++ b/Firestore/Example/Tests/Util/FSTHelpers.mm
@@ -179,7 +179,7 @@ FSTQuery *FSTTestQuery(const absl::string_view path) {
return [FSTQuery queryWithPath:testutil::Resource(path)];
}
-id<FSTFilter> FSTTestFilter(const absl::string_view field, NSString *opString, id value) {
+FSTFilter *FSTTestFilter(const absl::string_view field, NSString *opString, id value) {
const FieldPath path = testutil::Field(field);
FSTRelationFilterOperator op;
if ([opString isEqualToString:@"<"]) {
@@ -199,15 +199,8 @@ id<FSTFilter> FSTTestFilter(const absl::string_view field, NSString *opString, i
}
FSTFieldValue *data = FSTTestFieldValue(value);
- if ([data isEqual:[FSTDoubleValue nanValue]]) {
- HARD_ASSERT(op == FSTRelationFilterOperatorEqual, "Must use == with NAN.");
- return [[FSTNanFilter alloc] initWithField:path];
- } else if ([data isEqual:[FSTNullValue nullValue]]) {
- HARD_ASSERT(op == FSTRelationFilterOperatorEqual, "Must use == with Null.");
- return [[FSTNullFilter alloc] initWithField:path];
- } else {
- return [FSTRelationFilter filterWithField:path filterOperator:op value:data];
- }
+
+ return [FSTFilter filterWithField:path filterOperator:op value:data];
}
FSTSortOrder *FSTTestOrderBy(const absl::string_view field, NSString *direction) {