@@ -242,7 +242,7 @@ TEST_F(QueryTest, TestKeyOrderIsDescendingForDescendingInequality) {
242
242
QuerySnapshot snapshot = ReadDocuments (query);
243
243
EXPECT_EQ (std::vector<std::string>({" g" , " f" , " c" , " b" , " a" }),
244
244
QuerySnapshotToIds (snapshot));
245
-
245
+
246
246
const AggregateQuery& aggregate_query = query.Count ();
247
247
AggregateQuerySnapshot aggregate_snapshot = ReadAggregate (aggregate_query);
248
248
EXPECT_EQ (5 , aggregate_snapshot.count ());
@@ -258,8 +258,7 @@ TEST_F(QueryTest, TestUnaryFilterQueries) {
258
258
{" nan" , FieldValue::Double (NAN)}}}});
259
259
const Query& query = collection.WhereEqualTo (" null" , FieldValue::Null ())
260
260
.WhereEqualTo (" nan" , FieldValue::Double (NAN));
261
- QuerySnapshot snapshot =
262
- ReadDocuments (query);
261
+ QuerySnapshot snapshot = ReadDocuments (query);
263
262
EXPECT_EQ (std::vector<MapFieldValue>({{{" null" , FieldValue::Null ()},
264
263
{" nan" , FieldValue::Double (NAN)}}}),
265
264
QuerySnapshotToValues (snapshot));
@@ -473,7 +472,7 @@ TEST_F(QueryTest, TestCanQueryByDocumentId) {
473
472
474
473
// Query by Document Id.
475
474
const Query& query1 = collection.WhereEqualTo (FieldPath::DocumentId (),
476
- FieldValue::String (" ab" ));
475
+ FieldValue::String (" ab" ));
477
476
QuerySnapshot snapshot1 = ReadDocuments (query1);
478
477
EXPECT_EQ (std::vector<std::string>({" ab" }), QuerySnapshotToIds (snapshot1));
479
478
@@ -673,8 +672,7 @@ TEST_F(QueryTest, TestQueriesCanUseNotEqualFiltersWithNan) {
673
672
674
673
const Query& query =
675
674
collection.WhereNotEqualTo (" zip" , FieldValue::Double (NAN));
676
- QuerySnapshot snapshot =
677
- ReadDocuments (query);
675
+ QuerySnapshot snapshot = ReadDocuments (query);
678
676
EXPECT_THAT (QuerySnapshotToValues (snapshot),
679
677
ElementsAreArray (AllDocsExcept (docs, {" a" , " i" , " j" })));
680
678
@@ -698,12 +696,11 @@ TEST_F(QueryTest, TestQueriesCanUseNotEqualFiltersWithDocIds) {
698
696
QuerySnapshot snapshot = ReadDocuments (query);
699
697
EXPECT_EQ (std::vector<MapFieldValue>({doc_b, doc_c, doc_d}),
700
698
QuerySnapshotToValues (snapshot));
701
-
699
+
702
700
const AggregateQuery& aggregate_query = query.Count ();
703
701
AggregateQuerySnapshot aggregate_snapshot = ReadAggregate (aggregate_query);
704
702
EXPECT_EQ (3 , aggregate_snapshot.count ());
705
703
EXPECT_EQ (aggregate_query, aggregate_snapshot.query ());
706
-
707
704
}
708
705
709
706
TEST_F (QueryTest, TestQueriesCanUseArrayContainsFilters) {
@@ -740,7 +737,7 @@ TEST_F(QueryTest, TestQueriesCanUseArrayContainsFilters) {
740
737
AggregateQuerySnapshot aggregate_snapshot = ReadAggregate (aggregate_query);
741
738
EXPECT_EQ (3 , aggregate_snapshot.count ());
742
739
EXPECT_EQ (aggregate_query, aggregate_snapshot.query ());
743
-
740
+
744
741
// NOTE: The backend doesn't currently support null, NaN, objects, or arrays,
745
742
// so there isn't much of anything else interesting to test.
746
743
}
@@ -777,7 +774,7 @@ TEST_F(QueryTest, TestQueriesCanUseInFilters) {
777
774
AggregateQuerySnapshot aggregate_snapshot1 = ReadAggregate (aggregate_query1);
778
775
EXPECT_EQ (3 , aggregate_snapshot1.count ());
779
776
EXPECT_EQ (aggregate_query1, aggregate_snapshot1.query ());
780
-
777
+
781
778
// With objects.
782
779
const Query& query2 = collection.WhereIn (
783
780
" zip" , {FieldValue::Map ({{" code" , FieldValue::Integer (500 )}})});
@@ -844,7 +841,7 @@ TEST_F(QueryTest, TestQueriesCanUseNotInFilters) {
844
841
QuerySnapshot snapshot = ReadDocuments (query);
845
842
EXPECT_THAT (QuerySnapshotToValues (snapshot),
846
843
ElementsAreArray (AllDocsExcept (docs, {" c" , " d" , " f" , " i" , " j" })));
847
-
844
+
848
845
const AggregateQuery& aggregate_query = query.Count ();
849
846
AggregateQuerySnapshot aggregate_snapshot = ReadAggregate (aggregate_query);
850
847
EXPECT_EQ (5 , aggregate_snapshot.count ());
@@ -909,10 +906,9 @@ TEST_F(QueryTest, TestQueriesCanUseNotInFiltersWithNull) {
909
906
910
907
// With Null, this leads to no result.
911
908
const Query& query = collection.WhereNotIn (" zip" , {{FieldValue::Null ()}});
912
- QuerySnapshot snapshot =
913
- ReadDocuments (query);
909
+ QuerySnapshot snapshot = ReadDocuments (query);
914
910
EXPECT_THAT (QuerySnapshotToValues (snapshot), IsEmpty ());
915
-
911
+
916
912
const AggregateQuery& aggregate_query = query.Count ();
917
913
AggregateQuerySnapshot aggregate_snapshot = ReadAggregate (aggregate_query);
918
914
EXPECT_EQ (0 , aggregate_snapshot.count ());
@@ -944,8 +940,7 @@ TEST_F(QueryTest, TestQueriesCanUseNotInFiltersWithNan) {
944
940
// With NAN.
945
941
const Query& query =
946
942
collection.WhereNotIn (" zip" , {{FieldValue::Double (NAN)}});
947
- QuerySnapshot snapshot =
948
- ReadDocuments (query);
943
+ QuerySnapshot snapshot = ReadDocuments (query);
949
944
EXPECT_THAT (QuerySnapshotToValues (snapshot),
950
945
ElementsAreArray (AllDocsExcept (docs, {" a" , " i" , " j" })));
951
946
@@ -1051,7 +1046,7 @@ TEST_F(QueryTest, TestQueriesCanUseArrayContainsAnyFilters) {
1051
1046
AggregateQuerySnapshot aggregate_snapshot1 = ReadAggregate (aggregate_query1);
1052
1047
EXPECT_EQ (4 , aggregate_snapshot1.count ());
1053
1048
EXPECT_EQ (aggregate_query1, aggregate_snapshot1.query ());
1054
-
1049
+
1055
1050
// With objects
1056
1051
const Query& query2 = collection.WhereArrayContainsAny (
1057
1052
" array" , {FieldValue::Map ({{" a" , FieldValue::Integer (42 )}})});
@@ -1094,8 +1089,7 @@ TEST_F(QueryTest, TestCollectionGroupQueries) {
1094
1089
Await (batch.Commit ());
1095
1090
1096
1091
const Query& query = db->CollectionGroup (collection_group);
1097
- QuerySnapshot query_snapshot =
1098
- ReadDocuments (query);
1092
+ QuerySnapshot query_snapshot = ReadDocuments (query);
1099
1093
EXPECT_EQ (std::vector<std::string>(
1100
1094
{" cg-doc1" , " cg-doc2" , " cg-doc3" , " cg-doc4" , " cg-doc5" }),
1101
1095
QuerySnapshotToIds (query_snapshot));
@@ -1133,8 +1127,7 @@ TEST_F(QueryTest,
1133
1127
.OrderBy (FieldPath::DocumentId ())
1134
1128
.StartAt ({FieldValue::String (" a/b" )})
1135
1129
.EndAt ({FieldValue::String (" a/b0" )});
1136
- QuerySnapshot query_snapshot =
1137
- ReadDocuments (query);
1130
+ QuerySnapshot query_snapshot = ReadDocuments (query);
1138
1131
EXPECT_EQ (std::vector<std::string>({" cg-doc2" , " cg-doc3" , " cg-doc4" }),
1139
1132
QuerySnapshotToIds (query_snapshot));
1140
1133
@@ -1167,13 +1160,13 @@ TEST_F(QueryTest,
1167
1160
}
1168
1161
Await (batch.Commit ());
1169
1162
1170
- const Query& query1 = db-> CollectionGroup (collection_group)
1171
- . WhereGreaterThanOrEqualTo ( FieldPath::DocumentId (),
1172
- FieldValue::String ( " a/b " ))
1173
- . WhereLessThanOrEqualTo ( FieldPath::DocumentId (),
1174
- FieldValue::String ( " a/b0 " ));
1175
- QuerySnapshot query_snapshot =
1176
- ReadDocuments (query1);
1163
+ const Query& query1 =
1164
+ db-> CollectionGroup (collection_group)
1165
+ . WhereGreaterThanOrEqualTo ( FieldPath::DocumentId (),
1166
+ FieldValue::String ( " a/b " ))
1167
+ . WhereLessThanOrEqualTo ( FieldPath::DocumentId (),
1168
+ FieldValue::String ( " a/b0 " ));
1169
+ QuerySnapshot query_snapshot = ReadDocuments (query1);
1177
1170
EXPECT_EQ (std::vector<std::string>({" cg-doc2" , " cg-doc3" , " cg-doc4" }),
1178
1171
QuerySnapshotToIds (query_snapshot));
1179
1172
@@ -1188,8 +1181,7 @@ TEST_F(QueryTest,
1188
1181
.WhereLessThan (
1189
1182
FieldPath::DocumentId (),
1190
1183
FieldValue::String (" a/b/" + collection_group + " /cg-doc3" ));
1191
- query_snapshot = ReadDocuments (
1192
- query2);
1184
+ query_snapshot = ReadDocuments (query2);
1193
1185
EXPECT_EQ (std::vector<std::string>({" cg-doc2" }),
1194
1186
QuerySnapshotToIds (query_snapshot));
1195
1187
0 commit comments