diff options
Diffstat (limited to 'src/mongo/db/pipeline/expression_trim_test.cpp')
| -rw-r--r-- | src/mongo/db/pipeline/expression_trim_test.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/pipeline/expression_trim_test.cpp b/src/mongo/db/pipeline/expression_trim_test.cpp index 620b371c5f7..bf5a5d63302 100644 --- a/src/mongo/db/pipeline/expression_trim_test.cpp +++ b/src/mongo/db/pipeline/expression_trim_test.cpp @@ -722,14 +722,16 @@ TEST(ExpressionTrimTest, DoesSerializeCorrectly) { BSON("$trim" << BSON("input" << " abc ")), expCtx.variablesParseState); - ASSERT_VALUE_EQ(trim->serialize(false), trim->serialize(true)); + ASSERT_VALUE_EQ(trim->serialize(), + trim->serialize(SerializationOptions{ + boost::make_optional(ExplainOptions::Verbosity::kQueryPlanner)})); ASSERT_VALUE_EQ( - trim->serialize(false), + trim->serialize(), Value(Document{{"$trim", Document{{"input", Document{{"$const", " abc "_sd}}}}}})); // Make sure we can re-parse it and evaluate it. auto reparsedTrim = Expression::parseExpression( - &expCtx, trim->serialize(false).getDocument().toBson(), expCtx.variablesParseState); + &expCtx, trim->serialize().getDocument().toBson(), expCtx.variablesParseState); ASSERT_VALUE_EQ(reparsedTrim->evaluate({}, &expCtx.variables), Value("abc"_sd)); // Use $ltrim, and specify the 'chars' option. @@ -740,12 +742,12 @@ TEST(ExpressionTrimTest, DoesSerializeCorrectly) { << "$$CURRENT.a")), expCtx.variablesParseState); ASSERT_VALUE_EQ( - trim->serialize(false), + trim->serialize(), Value(Document{{"$ltrim", Document{{"input", "$inputField"_sd}, {"chars", "$a"_sd}}}})); // Make sure we can re-parse it and evaluate it. reparsedTrim = Expression::parseExpression( - &expCtx, trim->serialize(false).getDocument().toBson(), expCtx.variablesParseState); + &expCtx, trim->serialize().getDocument().toBson(), expCtx.variablesParseState); ASSERT_VALUE_EQ(reparsedTrim->evaluate(Document{{"inputField", " , 4"_sd}, {"a", " ,"_sd}}, &expCtx.variables), Value("4"_sd)); |
