1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Limit allocation.

This commit is contained in:
Vladimir Mihailenco
2016-11-09 10:04:37 +02:00
parent b6bfe529a8
commit 62cd3b38ef
3 changed files with 41 additions and 16 deletions

View File

@ -185,7 +185,7 @@ var _ = Describe("Client", func() {
})
It("should handle big vals", func() {
bigVal := string(bytes.Repeat([]byte{'*'}, 1<<17)) // 128kb
bigVal := bytes.Repeat([]byte{'*'}, 2e6)
err := client.Set("key", bigVal, 0).Err()
Expect(err).NotTo(HaveOccurred())
@ -194,9 +194,8 @@ var _ = Describe("Client", func() {
Expect(client.Close()).To(BeNil())
client = redis.NewClient(redisOptions())
got, err := client.Get("key").Result()
got, err := client.Get("key").Bytes()
Expect(err).NotTo(HaveOccurred())
Expect(len(got)).To(Equal(len(bigVal)))
Expect(got).To(Equal(bigVal))
})