Merge pull request #1084 from amrmahdi/amrh/NewZWithKeyCmdResult

Add NewZWithKeyCmdResult to initialize ZWithKeyCmd for testing
This commit is contained in:
Vladimir Mihailenco 2019-07-08 09:54:42 +03:00 committed by GitHub
commit 4bb1faed5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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