Skip to content

Commit ec5a55a

Browse files
committed
Fix mongoc_collection_count() + readConcern test
This would have passed even if readConcern was provided as the matcher ignores extra fields. We must explicitly say it cannot exist
1 parent 67c1691 commit ec5a55a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test-mongoc-collection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,7 @@ test_count_read_concern (void)
13211321
bson_destroy(&b);
13221322
request = mock_server_receives_command (
13231323
server, "test", MONGOC_QUERY_SLAVE_OK,
1324-
"{ 'count' : 'test', 'query' : { } }");
1324+
"{ 'count' : 'test', 'query' : { }, 'readConcern': { '$exists': false }}");
13251325

13261326
mock_server_replies_simple (request, "{ 'n' : 46, 'ok' : 1 } ");
13271327
count = future_get_int64_t (future);
@@ -1338,7 +1338,7 @@ test_count_read_concern (void)
13381338
bson_destroy(&b);
13391339
request = mock_server_receives_command (
13401340
server, "test", MONGOC_QUERY_SLAVE_OK,
1341-
"{ 'count' : 'test', 'query' : { } }");
1341+
"{ 'count' : 'test', 'query' : { }, 'readConcern': { '$exists': false }}");
13421342

13431343
mock_server_replies_simple (request, "{ 'n' : 47, 'ok' : 1 } ");
13441344
count = future_get_int64_t (future);

0 commit comments

Comments
 (0)