Skip to content

Commit

Permalink
GODRIVER-2698 Extend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
prestonvasquez committed Nov 15, 2023
1 parent 7930589 commit 8b2a76a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions mongo/collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,28 @@ func TestNewFindOptionsFromFindOneOptions(t *testing.T) {
options.Find().SetLimit(-1),
},
},
{
name: "singleton",
opts: []*options.FindOneOptions{
options.FindOne().SetSkip(1),
},
want: []*options.FindOptions{
options.Find().SetSkip(1),
options.Find().SetLimit(-1),
},
},
{
name: "multiplicity",
opts: []*options.FindOneOptions{
options.FindOne().SetSkip(1),
options.FindOne().SetSkip(2),
},
want: []*options.FindOptions{
options.Find().SetSkip(1),
options.Find().SetSkip(2),
options.Find().SetLimit(-1),
},
},
{
name: "interior null",
opts: []*options.FindOneOptions{
Expand All @@ -251,6 +273,32 @@ func TestNewFindOptionsFromFindOneOptions(t *testing.T) {
options.Find().SetLimit(-1),
},
},
{
name: "start null",
opts: []*options.FindOneOptions{
nil,
options.FindOne().SetSkip(1),
options.FindOne().SetSkip(2),
},
want: []*options.FindOptions{
options.Find().SetSkip(1),
options.Find().SetSkip(2),
options.Find().SetLimit(-1),
},
},
{
name: "end null",
opts: []*options.FindOneOptions{
options.FindOne().SetSkip(1),
options.FindOne().SetSkip(2),
nil,
},
want: []*options.FindOptions{
options.Find().SetSkip(1),
options.Find().SetSkip(2),
options.Find().SetLimit(-1),
},
},
}

for _, test := range tests {
Expand Down

0 comments on commit 8b2a76a

Please sign in to comment.