1
0
mirror of https://github.com/redis/go-redis.git synced 2025-06-14 01:21:30 +03:00

Fix slice grow in readN.

This commit is contained in:
Vladimir Mihailenco
2016-03-14 12:36:18 +02:00
parent 4665ad860f
commit 672fb9bb97
2 changed files with 12 additions and 2 deletions

View File

@ -15,10 +15,14 @@ import (
var _ = Describe("Command", func() {
var client *redis.Client
BeforeEach(func() {
client = redis.NewClient(&redis.Options{
connect := func() *redis.Client {
return redis.NewClient(&redis.Options{
Addr: redisAddr,
})
}
BeforeEach(func() {
client = connect()
})
AfterEach(func() {
@ -63,8 +67,13 @@ var _ = Describe("Command", func() {
Expect(set.Err()).NotTo(HaveOccurred())
Expect(set.Val()).To(Equal("OK"))
// Reconnect to get new connection.
Expect(client.Close()).To(BeNil())
client = connect()
get := client.Get("key")
Expect(get.Err()).NotTo(HaveOccurred())
Expect(len(get.Val())).To(Equal(len(val)))
Expect(get.Val()).To(Equal(val))
})