Add NewZWithKeyCmdResult to initialize ZWithKeyCmd for testing

This commit is contained in:
Amr Hanafi (MAHDI)) 2019-07-07 13:12:13 -07:00
parent 69cf7e5f6f
commit 03eeba66c1
1 changed files with 8 additions and 0 deletions

View File

@ -106,6 +106,14 @@ func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
return &cmd
}
// NewZWithKeyCmdResult returns a NewZWithKeyCmd initialised with val and err for testing
func NewZWithKeyCmdResult(val *ZWithKey, err error) *ZWithKeyCmd {
var cmd ZWithKeyCmd
cmd.val = val
cmd.setErr(err)
return &cmd
}
// NewScanCmdResult returns a ScanCmd initialised with val and err for testing
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
var cmd ScanCmd