Skip to content

Commit 73b8996

Browse files
authored
Update commands_test.go
Test the case of adding the args parameter nil for Eval and EvalRO
1 parent 5d7eaf8 commit 73b8996

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

commands_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7209,6 +7209,17 @@ var _ = Describe("Commands", func() {
72097209
Expect(err).NotTo(HaveOccurred())
72107210
Expect(vals).To(Equal([]interface{}{int64(12), proto.RedisError("error"), "abc"}))
72117211
})
7212+
7213+
It("returns empty values when args are nil", func() {
7214+
vals, err := client.Eval(
7215+
ctx,
7216+
"return {ARGV[1]}",
7217+
[]string{},
7218+
nil,
7219+
).Result()
7220+
Expect(err).NotTo(HaveOccurred())
7221+
Expect(vals).To(BeEmpty())
7222+
})
72127223
})
72137224

72147225
Describe("EvalRO", func() {
@@ -7232,6 +7243,17 @@ var _ = Describe("Commands", func() {
72327243
Expect(err).NotTo(HaveOccurred())
72337244
Expect(vals).To(Equal([]interface{}{int64(12), proto.RedisError("error"), "abc"}))
72347245
})
7246+
7247+
It("returns empty values when args are nil", func() {
7248+
vals, err := client.EvalRO(
7249+
ctx,
7250+
"return {ARGV[1]}",
7251+
[]string{},
7252+
nil,
7253+
).Result()
7254+
Expect(err).NotTo(HaveOccurred())
7255+
Expect(vals).To(BeEmpty())
7256+
})
72357257
})
72367258

72377259
Describe("Functions", func() {

0 commit comments

Comments
 (0)