@@ -77,6 +77,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
77
77
// 2. Performing the given query using source=server.
78
78
// 3. Performing the given query using source=cache.
79
79
func assertSdkQueryResultsConsistentWithBackend( _ documentDataMap: [ String : [ String : Any ] ] ,
80
+ collection: CollectionReference ,
80
81
query: Query ,
81
82
expectedResult: [ String ] ) async throws {
82
83
let watchSnapshot = try await Future < QuerySnapshot , Error > ( ) { promise in
@@ -97,7 +98,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
97
98
description: " snapshot listener "
98
99
)
99
100
100
- checkOnlineAndOfflineQuery ( query, matchesResult: expectedResult)
101
+ checkOnlineAndOfflineCollection ( collection , query : query, matchesResult: expectedResult)
101
102
}
102
103
103
104
func testCanWriteAndReadBsonTypes( ) async throws {
@@ -216,6 +217,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
216
217
217
218
try await assertSdkQueryResultsConsistentWithBackend (
218
219
testDocs,
220
+ collection: collection,
219
221
query: query,
220
222
expectedResult: [ " c " , " b " ]
221
223
)
@@ -229,6 +231,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
229
231
. order ( by: " key " , descending: true )
230
232
try await assertSdkQueryResultsConsistentWithBackend (
231
233
testDocs,
234
+ collection: collection,
232
235
query: query,
233
236
expectedResult: [ " b " , " a " ]
234
237
)
@@ -249,6 +252,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
249
252
. order ( by: " key " , descending: true )
250
253
try await assertSdkQueryResultsConsistentWithBackend (
251
254
testDocs,
255
+ collection: collection,
252
256
query: query,
253
257
expectedResult: [ " c " , " b " ]
254
258
)
@@ -258,6 +262,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
258
262
. order ( by: " key " , descending: true )
259
263
try await assertSdkQueryResultsConsistentWithBackend (
260
264
testDocs,
265
+ collection: collection,
261
266
query: query,
262
267
expectedResult: [ " c " , " a " ]
263
268
)
@@ -278,6 +283,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
278
283
. order ( by: " key " , descending: true )
279
284
try await assertSdkQueryResultsConsistentWithBackend (
280
285
testDocs,
286
+ collection: collection,
281
287
query: query,
282
288
expectedResult: [ " c " , " b " ]
283
289
)
@@ -287,6 +293,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
287
293
. order ( by: " key " , descending: true )
288
294
try await assertSdkQueryResultsConsistentWithBackend (
289
295
testDocs,
296
+ collection: collection,
290
297
query: query,
291
298
expectedResult: [ " c " , " b " ]
292
299
)
@@ -310,6 +317,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
310
317
. order ( by: " key " , descending: true )
311
318
try await assertSdkQueryResultsConsistentWithBackend (
312
319
testDocs,
320
+ collection: collection,
313
321
query: query,
314
322
expectedResult: [ " c " , " b " ]
315
323
)
@@ -326,6 +334,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
326
334
. order ( by: " key " , descending: true )
327
335
try await assertSdkQueryResultsConsistentWithBackend (
328
336
testDocs,
337
+ collection: collection,
329
338
query: query,
330
339
expectedResult: [ " b " , " a " ]
331
340
)
@@ -350,6 +359,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
350
359
) . order ( by: " key " , descending: true )
351
360
try await assertSdkQueryResultsConsistentWithBackend (
352
361
testDocs,
362
+ collection: collection,
353
363
query: query,
354
364
expectedResult: [ " c " , " a " ]
355
365
)
@@ -372,6 +382,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
372
382
. order ( by: " key " , descending: true )
373
383
try await assertSdkQueryResultsConsistentWithBackend (
374
384
testDocs,
385
+ collection: collection,
375
386
query: query,
376
387
expectedResult: [ " b " , " a " ]
377
388
)
@@ -383,6 +394,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
383
394
// .order(by: "key")
384
395
// try await assertSdkQueryResultsConsistentWithBackend(
385
396
// testDocs,
397
+ // collection: collection,
386
398
// query: query2,
387
399
// expectedResult: ["d", "e"]
388
400
// )
@@ -392,6 +404,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
392
404
. order ( by: " key " )
393
405
try await assertSdkQueryResultsConsistentWithBackend (
394
406
testDocs,
407
+ collection: collection,
395
408
query: query,
396
409
expectedResult: [ " a " , " b " ]
397
410
)
@@ -401,6 +414,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
401
414
. order ( by: " key " )
402
415
try await assertSdkQueryResultsConsistentWithBackend (
403
416
testDocs,
417
+ collection: collection,
404
418
query: query,
405
419
expectedResult: [ " a " , " b " ]
406
420
)
@@ -410,6 +424,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
410
424
. order ( by: " key " )
411
425
try await assertSdkQueryResultsConsistentWithBackend (
412
426
testDocs,
427
+ collection: collection,
413
428
query: query,
414
429
expectedResult: [ ]
415
430
)
@@ -419,6 +434,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
419
434
. order ( by: " key " )
420
435
try await assertSdkQueryResultsConsistentWithBackend (
421
436
testDocs,
437
+ collection: collection,
422
438
query: query,
423
439
expectedResult: [ ]
424
440
)
@@ -428,6 +444,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
428
444
. order ( by: " key " )
429
445
try await assertSdkQueryResultsConsistentWithBackend (
430
446
testDocs,
447
+ collection: collection,
431
448
query: query,
432
449
expectedResult: [ ]
433
450
)
@@ -450,6 +467,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
450
467
. order ( by: " key " )
451
468
try await assertSdkQueryResultsConsistentWithBackend (
452
469
testDocs,
470
+ collection: collection,
453
471
query: query,
454
472
expectedResult: [ " c " , " d " ]
455
473
)
@@ -461,6 +479,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
461
479
// .order(by: "key")
462
480
// try await assertSdkQueryResultsConsistentWithBackend(
463
481
// testDocs,
482
+ // collection: collection,
464
483
// query: query,
465
484
// expectedResult: ["a", "b"]
466
485
// )
@@ -470,6 +489,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
470
489
. order ( by: " key " )
471
490
try await assertSdkQueryResultsConsistentWithBackend (
472
491
testDocs,
492
+ collection: collection,
473
493
query: query,
474
494
expectedResult: [ " c " , " d " ]
475
495
)
@@ -479,6 +499,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
479
499
. order ( by: " key " )
480
500
try await assertSdkQueryResultsConsistentWithBackend (
481
501
testDocs,
502
+ collection: collection,
482
503
query: query,
483
504
expectedResult: [ " c " , " d " ]
484
505
)
@@ -488,6 +509,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
488
509
. order ( by: " key " )
489
510
try await assertSdkQueryResultsConsistentWithBackend (
490
511
testDocs,
512
+ collection: collection,
491
513
query: query,
492
514
expectedResult: [ ]
493
515
)
@@ -497,6 +519,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
497
519
. order ( by: " key " )
498
520
try await assertSdkQueryResultsConsistentWithBackend (
499
521
testDocs,
522
+ collection: collection,
500
523
query: query,
501
524
expectedResult: [ ]
502
525
)
@@ -506,6 +529,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
506
529
. order ( by: " key " )
507
530
try await assertSdkQueryResultsConsistentWithBackend (
508
531
testDocs,
532
+ collection: collection,
509
533
query: query,
510
534
expectedResult: [ ]
511
535
)
@@ -528,6 +552,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
528
552
. order ( by: " key " )
529
553
try await assertSdkQueryResultsConsistentWithBackend (
530
554
testDocs,
555
+ collection: collection,
531
556
query: query,
532
557
expectedResult: [ " b " , " c " ]
533
558
)
@@ -537,6 +562,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
537
562
. order ( by: " key " )
538
563
try await assertSdkQueryResultsConsistentWithBackend (
539
564
testDocs,
565
+ collection: collection,
540
566
query: query,
541
567
expectedResult: [ " a " , " d " , " e " ]
542
568
)
@@ -571,27 +597,29 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
571
597
await setDocumentData ( testDocs, toCollection: collection)
572
598
573
599
let query = collection. order ( by: " key " , descending: true )
574
- try await assertSdkQueryResultsConsistentWithBackend ( testDocs, query: query, expectedResult: [
575
- " maxKey2 " ,
576
- " maxKey1 " ,
577
- " regex3 " ,
578
- " regex1 " ,
579
- " regex2 " ,
580
- " bsonObjectId2 " ,
581
- " bsonObjectId1 " ,
582
- " bsonObjectId3 " ,
583
- " bsonBinary3 " ,
584
- " bsonBinary2 " ,
585
- " bsonBinary1 " ,
586
- " bsonTimestamp1 " ,
587
- " bsonTimestamp2 " ,
588
- " bsonTimestamp3 " ,
589
- " int32Value2 " ,
590
- " int32Value3 " ,
591
- " int32Value1 " ,
592
- " minKey2 " ,
593
- " minKey1 " ,
594
- ] )
600
+ try await assertSdkQueryResultsConsistentWithBackend ( testDocs,
601
+ collection: collection,
602
+ query: query, expectedResult: [
603
+ " maxKey2 " ,
604
+ " maxKey1 " ,
605
+ " regex3 " ,
606
+ " regex1 " ,
607
+ " regex2 " ,
608
+ " bsonObjectId2 " ,
609
+ " bsonObjectId1 " ,
610
+ " bsonObjectId3 " ,
611
+ " bsonBinary3 " ,
612
+ " bsonBinary2 " ,
613
+ " bsonBinary1 " ,
614
+ " bsonTimestamp1 " ,
615
+ " bsonTimestamp2 " ,
616
+ " bsonTimestamp3 " ,
617
+ " int32Value2 " ,
618
+ " int32Value3 " ,
619
+ " int32Value1 " ,
620
+ " minKey2 " ,
621
+ " minKey1 " ,
622
+ ] )
595
623
}
596
624
597
625
func testCanOrderValuesOfDifferentTypes( ) async throws {
@@ -652,6 +680,7 @@ class BsonTypesIntegrationTests: FSTIntegrationTestCase {
652
680
653
681
try await assertSdkQueryResultsConsistentWithBackend (
654
682
testDocs,
683
+ collection: collection,
655
684
query: orderedQuery,
656
685
expectedResult: expectedOrder
657
686
)
0 commit comments