Skip to content

Commit

Permalink
feat: add NewXPendingResult for unit testing XPending (#2066)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilstreak committed Apr 5, 2022
1 parent 2baad40 commit b7fd09e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions result.go
Expand Up @@ -178,3 +178,11 @@ func NewXStreamSliceCmdResult(val []XStream, err error) *XStreamSliceCmd {
cmd.SetErr(err)
return &cmd
}

// NewXPendingResult returns a XPendingCmd initialised with val and err for testing.
func NewXPendingResult(val *XPending, err error) *XPendingCmd {
var cmd XPendingCmd
cmd.val = val
cmd.SetErr(err)
return &cmd
}

0 comments on commit b7fd09e

Please sign in to comment.