Skip to content

Commit edfcfee

Browse files
committed
Add tests
1 parent fbd8876 commit edfcfee

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

internal_test.go

+24
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,27 @@ var _ = Describe("withConn", func() {
352352
Expect(client.connPool.Len()).To(Equal(1))
353353
})
354354
})
355+
356+
var _ = Describe("ClusterClient", func() {
357+
var client *ClusterClient
358+
359+
BeforeEach(func() {
360+
client = &ClusterClient{}
361+
})
362+
363+
Describe("cmdSlot", func() {
364+
It("select slot from args for GETKEYSINSLOT command", func() {
365+
cmd := NewStringSliceCmd(ctx, "cluster", "getkeysinslot", 100, 200)
366+
367+
slot := client.cmdSlot(context.Background(), cmd)
368+
Expect(slot).To(Equal(100))
369+
})
370+
371+
It("select slot from args for COUNTKEYSINSLOT command", func() {
372+
cmd := NewStringSliceCmd(ctx, "cluster", "countkeysinslot", 100)
373+
374+
slot := client.cmdSlot(context.Background(), cmd)
375+
Expect(slot).To(Equal(100))
376+
})
377+
})
378+
})

0 commit comments

Comments
 (0)