diff options
Diffstat (limited to 'dbtests')
-rw-r--r-- | dbtests/updatetests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dbtests/updatetests.cpp b/dbtests/updatetests.cpp index fdb9515023c..3a64a6039f7 100644 --- a/dbtests/updatetests.cpp +++ b/dbtests/updatetests.cpp @@ -301,6 +301,15 @@ namespace UpdateTests { } }; + class Push : public SetBase { + public: + void run() { + client().insert( ns(), fromjson( "{'_id':0,a:[1]}" ) ); + client().update( ns(), Query(), BSON( "$push" << BSON( "a" << 5 ) ) ); + ASSERT( client().findOne( ns(), Query() ).woCompare( fromjson( "{'_id':0,a:[1,5]}" ) ) == 0 ); + } + }; + class All : public UnitTest::Suite { public: All() { @@ -331,6 +340,7 @@ namespace UpdateTests { add< ModOverwritesExistingObject >(); add< InvalidEmbeddedSet >(); add< UpsertMissingEmbedded >(); + add< Push >(); } }; |