forked from mirror/redis
Merge pull request #1084 from amrmahdi/amrh/NewZWithKeyCmdResult
Add NewZWithKeyCmdResult to initialize ZWithKeyCmd for testing
This commit is contained in:
commit
4bb1faed5d
|
@ -106,6 +106,14 @@ func NewZSliceCmdResult(val []Z, err error) *ZSliceCmd {
|
||||||
return &cmd
|
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
|
// NewScanCmdResult returns a ScanCmd initialised with val and err for testing
|
||||||
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
|
func NewScanCmdResult(keys []string, cursor uint64, err error) *ScanCmd {
|
||||||
var cmd ScanCmd
|
var cmd ScanCmd
|
||||||
|
|
Loading…
Reference in New Issue