From 03eeba66c1830b25a3df80028e07473594184fea Mon Sep 17 00:00:00 2001 From: "Amr Hanafi (MAHDI))" Date: Sun, 7 Jul 2019 13:12:13 -0700 Subject: [PATCH] Add NewZWithKeyCmdResult to initialize ZWithKeyCmd for testing --- result.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/result.go b/result.go index e438f260..4356b28e 100644 --- a/result.go +++ b/result.go @@ -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