Skip to content

Commit

Permalink
Last minute fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Mar 7, 2024
1 parent 25730b5 commit 2ffb50a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/wire/op_reply.go
Expand Up @@ -135,9 +135,9 @@ func (reply *OpReply) String() string {
))

if reply.document == nil {
must.NoError(m.Add("NumberReturned", 0))
must.NoError(m.Add("NumberReturned", int32(0)))

Check warning on line 138 in internal/wire/op_reply.go

View check run for this annotation

Codecov / codecov/patch

internal/wire/op_reply.go#L138

Added line #L138 was not covered by tests
} else {
must.NoError(m.Add("NumberReturned", 1))
must.NoError(m.Add("NumberReturned", int32(1)))

doc, err := reply.document.DecodeDeep()
if err == nil {
Expand Down
2 changes: 2 additions & 0 deletions internal/wire/op_reply_test.go
Expand Up @@ -61,6 +61,7 @@ var replyTestCases = []testCase{
"ResponseFlags": "[AwaitCapable]",
"CursorID": int64(0),
"StartingFrom": 0,
"NumberReturned": 1,
"Document": {
"ismaster": true,
"topologyVersion": {"processId": ObjectID(60fbed5371fe1bae70339505), "counter": int64(0)},
Expand Down Expand Up @@ -114,6 +115,7 @@ var replyTestCases = []testCase{
"ResponseFlags": "[AwaitCapable]",
"CursorID": int64(0),
"StartingFrom": 0,
"NumberReturned": 1,
"Document": {
"ismaster": true,
"topologyVersion": {"processId": ObjectID(60fbed5371fe1bae70339505), "counter": int64(0)},
Expand Down

0 comments on commit 2ffb50a

Please sign in to comment.