diff --git a/result.go b/result.go index 24cfd499..34e9de8b 100644 --- a/result.go +++ b/result.go @@ -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 +}