Skip to content

Commit a4748fe

Browse files
Added Process and BatchProcess tests
1 parent e329b9e commit a4748fe

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pipeline_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,25 @@ var _ = Describe("pipelining", func() {
114114
err := pipe.Do(ctx).Err()
115115
Expect(err).To(Equal(errors.New("redis: please enter the command to be executed")))
116116
})
117+
118+
It("should process", func() {
119+
err := pipe.Process(ctx, redis.NewCmd(ctx, "asking"))
120+
Expect(err).To(Equal(nil))
121+
Expect(pipe.Cmds()).To(HaveLen(1))
122+
})
123+
124+
It("should batchProcess", func() {
125+
err := pipe.BatchProcess(ctx, redis.NewCmd(ctx, "asking"))
126+
Expect(err).To(Equal(nil))
127+
Expect(pipe.Cmds()).To(HaveLen(1))
128+
129+
pipe.Discard()
130+
Expect(pipe.Cmds()).To(HaveLen(0))
131+
132+
err = pipe.BatchProcess(ctx, redis.NewCmd(ctx, "asking"), redis.NewCmd(ctx, "set", "key", "value"))
133+
Expect(err).To(Equal(nil))
134+
Expect(pipe.Cmds()).To(HaveLen(2))
135+
})
117136
}
118137

119138
Describe("Pipeline", func() {

0 commit comments

Comments
 (0)