summaryrefslogtreecommitdiff
path: root/src/mongo/db/update/update_driver_test.cpp
diff options
context:
space:
mode:
authorJunhson Jean-Baptiste <junhson.jean-baptiste@mongodb.com>2020-07-15 20:23:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-04 21:51:57 +0000
commitf1194464424569250152308e3cae1ecbade7fb71 (patch)
treec8dbd00b63823ed35d11a163d5f852458fe47f2d /src/mongo/db/update/update_driver_test.cpp
parentee837757591fb1f5f4eecd324fd2a8fa56d3a8e4 (diff)
downloadmongo-f1194464424569250152308e3cae1ecbade7fb71.tar.gz
SERVER-49117 Remove storage validation of '$' and '.' in field names for insert and update
Diffstat (limited to 'src/mongo/db/update/update_driver_test.cpp')
-rw-r--r--src/mongo/db/update/update_driver_test.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/db/update/update_driver_test.cpp b/src/mongo/db/update/update_driver_test.cpp
index 5c736122c65..c9610841d80 100644
--- a/src/mongo/db/update/update_driver_test.cpp
+++ b/src/mongo/db/update/update_driver_test.cpp
@@ -128,15 +128,12 @@ TEST(Parse, EmptyMod) {
"'$set' is empty. You must specify a field like so: {$set: {<field>: ...}}");
}
-TEST(Parse, WrongMod) {
+TEST(Parse, UnknownMod) {
boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest());
UpdateDriver driver(expCtx);
std::map<StringData, std::unique_ptr<ExpressionWithPlaceholder>> arrayFilters;
- ASSERT_THROWS_CODE_AND_WHAT(driver.parse(fromjson("{$xyz:{a:1}}"), arrayFilters),
- AssertionException,
- ErrorCodes::FailedToParse,
- "Unknown modifier: $xyz. Expected a valid update modifier or "
- "pipeline-style update specified as an array");
+ ASSERT_DOES_NOT_THROW(driver.parse(fromjson("{$xyz:{a:1}}"), arrayFilters));
+ ASSERT_TRUE(driver.type() == UpdateDriver::UpdateType::kReplacement);
}
TEST(Parse, WrongType) {