DEATH_TEST_REGEX_F(DocumentSourceMatchTest,
                   ShouldFailToDescendExpressionOnPathThatIsNotACommonPrefix,
                   "Invariant failure.*expression::isPathPrefixOf") {
    const auto expCtx = getExpCtx();
    const auto matchSpec = BSON("a.b" << 1 << "b.c" << 1);
    const auto matchExpression =
        unittest::assertGet(MatchExpressionParser::parse(matchSpec, expCtx));
    DocumentSourceMatch::descendMatchOnPath(matchExpression.get(), "a", expCtx);
}
DEATH_TEST_REGEX_F(DocumentSourceMatchTest,
                   ShouldFailToDescendExpressionOnPathThatIsNotACommonPrefix,
                   "Invariant failure.*expression::isPathPrefixOf") {
    const auto expCtx = getExpCtx();
    const auto matchSpec = BSON("a.b" << 1 << "b.c" << 1);
    const auto matchExpression =
        unittest::assertGet(MatchExpressionParser::parse(matchSpec, expCtx));
    DocumentSourceMatch::descendMatchOnPath(matchExpression.get(), "a", expCtx);
}