diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-11 15:07:35 -0300 |
| commit | 4cb8841196d0625dfa3825aa326f071cd27c7b8b (patch) | |
| tree | 1682a647d4463397c119183369ae6f750d5fdcff /src/mongo/db/update/addtoset_node_test.cpp | |
| parent | aa03c6362cbaa767638e6eed9b031d86dd2643d1 (diff) | |
| parent | 8f0827553e09872941945a093b647a4211a9db7f (diff) | |
Update upstream source from tag 'upstream/6.0.0'master
Update to upstream version '6.0.0'
with Debian dir 5604a80ec1c96ca76f25f40d78e6ef855abec322
Diffstat (limited to 'src/mongo/db/update/addtoset_node_test.cpp')
| -rw-r--r-- | src/mongo/db/update/addtoset_node_test.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/mongo/db/update/addtoset_node_test.cpp b/src/mongo/db/update/addtoset_node_test.cpp index f590c7140dc..d2b7f90be65 100644 --- a/src/mongo/db/update/addtoset_node_test.cpp +++ b/src/mongo/db/update/addtoset_node_test.cpp @@ -99,23 +99,6 @@ TEST(AddToSetNodeTest, InitSucceedsWithArray) { ASSERT_OK(node.init(update["$addToSet"]["a"], expCtx)); } -TEST(AddToSetNodeTest, InitFailsWhenArgumentIsInvalidBSONArray) { - // Create our invalid array by creating a BSONObj with non contiguous array indexes that is then - // passed to the BSONArray ctor. - BSONObj updateArrAsObj = BSON("0" - << "foo" - << "2" - << "bar"); - BSONArray updateArr(updateArrAsObj); - - auto update = BSON("$addToSet" << BSON("fieldName" << BSON("$each" << updateArr))); - boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); - AddToSetNode node; - - ASSERT_THROWS(node.init(update["$addToSet"]["fieldName"], expCtx), - ExceptionFor<ErrorCodes::BadValue>); -} - TEST(AddToSetNodeTest, InitSucceedsWithScaler) { auto update = fromjson("{$addToSet: {a: 1}}"); boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); |
