@@ -817,6 +817,12 @@ func TestCollection_DeleteOne_WriteConcernError(t *testing.T) {
817
817
}
818
818
}
819
819
820
+ func TestCollection_UpdateOne_EmptyUpdate (t * testing.T ) {
821
+ coll := createTestCollection (t , nil , nil )
822
+ _ , err := coll .UpdateOne (ctx , bsonx.Doc {}, bsonx.Doc {})
823
+ require .NotNil (t , err )
824
+ }
825
+
820
826
func TestCollection_UpdateOne_found (t * testing.T ) {
821
827
if testing .Short () {
822
828
t .Skip ("skipping integration test in short mode" )
@@ -933,6 +939,12 @@ func TestCollection_UpdateOne_WriteConcernError(t *testing.T) {
933
939
}
934
940
}
935
941
942
+ func TestCollection_UpdateMany_EmptyUpdate (t * testing.T ) {
943
+ coll := createTestCollection (t , nil , nil )
944
+ _ , err := coll .UpdateMany (ctx , bsonx.Doc {}, bsonx.Doc {})
945
+ require .NotNil (t , err )
946
+ }
947
+
936
948
func TestCollection_UpdateMany_found (t * testing.T ) {
937
949
if testing .Short () {
938
950
t .Skip ("skipping integration test in short mode" )
@@ -1790,6 +1802,12 @@ func TestCollection_FindOneAndUpdate_found(t *testing.T) {
1790
1802
require .Equal (t , int (elem .Int32 ()), 3 )
1791
1803
}
1792
1804
1805
+ func TestCollection_FindOneAndUpdate_EmptyUpdate (t * testing.T ) {
1806
+ coll := createTestCollection (t , nil , nil )
1807
+ res := coll .FindOneAndUpdate (context .Background (), bsonx.Doc {}, bsonx.Doc {})
1808
+ require .NotNil (t , res .Err ())
1809
+ }
1810
+
1793
1811
func TestCollection_FindOneAndUpdate_found_ignoreResult (t * testing.T ) {
1794
1812
if testing .Short () {
1795
1813
t .Skip ("skipping integration test in short mode" )
0 commit comments