summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_request_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/query_request_test.cpp')
-rw-r--r--src/mongo/db/query/query_request_test.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mongo/db/query/query_request_test.cpp b/src/mongo/db/query/query_request_test.cpp
index 8906d5c2a7d..0834cd6e4c8 100644
--- a/src/mongo/db/query/query_request_test.cpp
+++ b/src/mongo/db/query/query_request_test.cpp
@@ -1178,10 +1178,15 @@ TEST(QueryRequestTest, ConvertToAggregationWithReturnKeyFails) {
ASSERT_NOT_OK(qr.asAggregationCommand());
}
-TEST(QueryRequestTest, ConvertToAggregationWithCommentFails) {
+TEST(QueryRequestTest, ConvertToAggregationWithCommentSucceeds) {
QueryRequest qr(testns);
qr.setComment("test");
- ASSERT_NOT_OK(qr.asAggregationCommand());
+ const auto aggCmd = qr.asAggregationCommand();
+ ASSERT_OK(aggCmd);
+
+ auto ar = AggregationRequest::parseFromBSON(testns, aggCmd.getValue());
+ ASSERT_OK(ar.getStatus());
+ ASSERT_EQ(qr.getComment(), ar.getValue().getComment());
}
TEST(QueryRequestTest, ConvertToAggregationWithShowRecordIdFails) {