diff options
Diffstat (limited to 'src/mongo/db/views/resolved_view_test.cpp')
-rw-r--r-- | src/mongo/db/views/resolved_view_test.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/views/resolved_view_test.cpp b/src/mongo/db/views/resolved_view_test.cpp index e25c5b263b7..cd34a8e6cf4 100644 --- a/src/mongo/db/views/resolved_view_test.cpp +++ b/src/mongo/db/views/resolved_view_test.cpp @@ -125,6 +125,15 @@ TEST(ResolvedViewTest, ExpandingAggRequestPreservesCollation) { << "fr_CA")); } +TEST(ResolvedViewTest, ExpandingAggRequestPreservesComment) { + const ResolvedView resolvedView{backingNss, emptyPipeline}; + AggregationRequest aggRequest(viewNss, {}); + aggRequest.setComment("agg_comment"); + + auto result = resolvedView.asExpandedViewAggregation(aggRequest); + ASSERT_EQ(result.getComment(), "agg_comment"); +} + TEST(ResolvedViewTest, FromBSONFailsIfMissingResolvedView) { BSONObj badCmdResponse = BSON("x" << 1); ASSERT_THROWS_CODE(ResolvedView::fromBSON(badCmdResponse), UserException, 40248); |