summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-04-16 05:37:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2018-04-16 08:37:14 -0400
commit6e2cb00008cbf09e556b00f87603797fcaa47e09 (patch)
tree3c0eb55ff4226a3f024aad373140d1fb860a6404 /vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go
parentbf24f51c4e1cc6286885460672f7f449e8c6f5ef (diff)
downloadchat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.gz
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.tar.bz2
chat-6e2cb00008cbf09e556b00f87603797fcaa47e09.zip
Depenancy upgrades and movign to dep. (#8630)
Diffstat (limited to 'vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go')
-rw-r--r--vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go63
1 files changed, 0 insertions, 63 deletions
diff --git a/vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go b/vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go
deleted file mode 100644
index 84799ff3b..000000000
--- a/vendor/github.com/go-redis/redis/internal/proto/write_buffer_test.go
+++ /dev/null
@@ -1,63 +0,0 @@
-package proto_test
-
-import (
- "testing"
- "time"
-
- "github.com/go-redis/redis/internal/proto"
-
- . "github.com/onsi/ginkgo"
- . "github.com/onsi/gomega"
-)
-
-var _ = Describe("WriteBuffer", func() {
- var buf *proto.WriteBuffer
-
- BeforeEach(func() {
- buf = proto.NewWriteBuffer()
- })
-
- It("should reset", func() {
- buf.AppendString("string")
- Expect(buf.Len()).To(Equal(12))
- buf.Reset()
- Expect(buf.Len()).To(Equal(0))
- })
-
- It("should append args", func() {
- err := buf.Append([]interface{}{
- "string",
- 12,
- 34.56,
- []byte{'b', 'y', 't', 'e', 's'},
- true,
- nil,
- })
- Expect(err).NotTo(HaveOccurred())
- Expect(buf.Bytes()).To(Equal([]byte("*6\r\n" +
- "$6\r\nstring\r\n" +
- "$2\r\n12\r\n" +
- "$5\r\n34.56\r\n" +
- "$5\r\nbytes\r\n" +
- "$1\r\n1\r\n" +
- "$0\r\n" +
- "\r\n")))
- })
-
- It("should append marshalable args", func() {
- err := buf.Append([]interface{}{time.Unix(1414141414, 0)})
- Expect(err).NotTo(HaveOccurred())
- Expect(buf.Len()).To(Equal(26))
- })
-
-})
-
-func BenchmarkWriteBuffer_Append(b *testing.B) {
- buf := proto.NewWriteBuffer()
- args := []interface{}{"hello", "world", "foo", "bar"}
-
- for i := 0; i < b.N; i++ {
- buf.Append(args)
- buf.Reset()
- }
-}