TEST_F(DocumentSourceMatchTest, ShouldShowOptimizationsInExplainOutputWhenOptimized) {
    const auto match = DocumentSourceMatch::create(fromjson("{$and: [{a: 1}]}"), getExpCtx());

    auto optimizedMatch = match->optimize();

    auto expectedMatch = fromjson("{$match: {a:{$eq: 1}}}");

    ASSERT_VALUE_EQ(
        Value((static_cast<DocumentSourceMatch*>(optimizedMatch.get()))->serialize(kExplain)),
        Value(expectedMatch));
}
TEST_F(DocumentSourceMatchTest, ShouldShowOptimizationsInExplainOutputWhenOptimized) {
    const auto match = DocumentSourceMatch::create(fromjson("{$and: [{a: 1}]}"), getExpCtx());

    auto optimizedMatch = match->optimize();

    auto expectedMatch = fromjson("{$match: {a:{$eq: 1}}}");

    ASSERT_VALUE_EQ(
        Value((static_cast<DocumentSourceMatch*>(optimizedMatch.get()))->serialize(kExplain)),
        Value(expectedMatch));
}