Skip to content

Commit cd030da

Browse files
committed
add tests
1 parent 15f4859 commit cd030da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

commands_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,17 @@ var _ = Describe("Commands", func() {
291291
}()
292292
pipe.ClientSetInfo(ctx, libInfo)
293293
}).To(Panic())
294+
// Test setting the default options for libName, libName suffix and libVer
295+
clientInfo := client.ClientInfo(ctx).Val()
296+
Expect(clientInfo.LibName).To(ContainSubstring("go-redis(go-redis,"))
297+
// Test setting the libName suffix in options
298+
opt := redisOptions()
299+
opt.IdentitySuffix = "suffix"
300+
client2 := redis.NewClient(opt)
301+
defer client2.Close()
302+
clientInfo = client2.ClientInfo(ctx).Val()
303+
Expect(clientInfo.LibName).To(ContainSubstring("go-redis(suffix,"))
304+
294305
})
295306

296307
It("should ConfigGet", func() {

0 commit comments

Comments
 (0)