cluster test suite

This commit is contained in:
hdt3213
2022-04-13 20:48:42 +08:00
parent 8d08f1d8c2
commit 3605f09def
13 changed files with 371 additions and 175 deletions

View File

@@ -21,6 +21,17 @@ func AssertIntReply(t *testing.T, actual redis.Reply, expected int) {
}
}
func AssertIntReplyGreaterThan(t *testing.T, actual redis.Reply, expected int) {
intResult, ok := actual.(*protocol.IntReply)
if !ok {
t.Errorf("expected int protocol, actually %s, %s", actual.ToBytes(), printStack())
return
}
if intResult.Code < int64(expected) {
t.Errorf("expected %d, actually %d, %s", expected, intResult.Code, printStack())
}
}
// AssertBulkReply checks if the given redis.Reply is the expected string
func AssertBulkReply(t *testing.T, actual redis.Reply, expected string) {
bulkReply, ok := actual.(*protocol.BulkReply)