summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mailru/easyjson/buffer
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/mailru/easyjson/buffer
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/mailru/easyjson/buffer')
-rw-r--r--vendor/github.com/mailru/easyjson/buffer/pool_test.go107
1 files changed, 0 insertions, 107 deletions
diff --git a/vendor/github.com/mailru/easyjson/buffer/pool_test.go b/vendor/github.com/mailru/easyjson/buffer/pool_test.go
deleted file mode 100644
index 680623ace..000000000
--- a/vendor/github.com/mailru/easyjson/buffer/pool_test.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package buffer
-
-import (
- "bytes"
- "testing"
-)
-
-func TestAppendByte(t *testing.T) {
- var b Buffer
- var want []byte
-
- for i := 0; i < 1000; i++ {
- b.AppendByte(1)
- b.AppendByte(2)
- want = append(want, 1, 2)
- }
-
- got := b.BuildBytes()
- if !bytes.Equal(got, want) {
- t.Errorf("BuildBytes() = %v; want %v", got, want)
- }
-}
-
-func TestAppendBytes(t *testing.T) {
- var b Buffer
- var want []byte
-
- for i := 0; i < 1000; i++ {
- b.AppendBytes([]byte{1, 2})
- want = append(want, 1, 2)
- }
-
- got := b.BuildBytes()
- if !bytes.Equal(got, want) {
- t.Errorf("BuildBytes() = %v; want %v", got, want)
- }
-}
-
-func TestAppendString(t *testing.T) {
- var b Buffer
- var want []byte
-
- s := "test"
- for i := 0; i < 1000; i++ {
- b.AppendBytes([]byte(s))
- want = append(want, s...)
- }
-
- got := b.BuildBytes()
- if !bytes.Equal(got, want) {
- t.Errorf("BuildBytes() = %v; want %v", got, want)
- }
-}
-
-func TestDumpTo(t *testing.T) {
- var b Buffer
- var want []byte
-
- s := "test"
- for i := 0; i < 1000; i++ {
- b.AppendBytes([]byte(s))
- want = append(want, s...)
- }
-
- out := &bytes.Buffer{}
- n, err := b.DumpTo(out)
- if err != nil {
- t.Errorf("DumpTo() error: %v", err)
- }
-
- got := out.Bytes()
- if !bytes.Equal(got, want) {
- t.Errorf("DumpTo(): got %v; want %v", got, want)
- }
-
- if n != len(want) {
- t.Errorf("DumpTo() = %v; want %v", n, len(want))
- }
-}
-
-func TestReadCloser(t *testing.T) {
- var b Buffer
- var want []byte
-
- s := "test"
- for i := 0; i < 1000; i++ {
- b.AppendBytes([]byte(s))
- want = append(want, s...)
- }
-
- out := &bytes.Buffer{}
- rc := b.ReadCloser()
- n, err := out.ReadFrom(rc)
- if err != nil {
- t.Errorf("ReadCloser() error: %v", err)
- }
- rc.Close() // Will always return nil
-
- got := out.Bytes()
- if !bytes.Equal(got, want) {
- t.Errorf("DumpTo(): got %v; want %v", got, want)
- }
-
- if n != int64(len(want)) {
- t.Errorf("DumpTo() = %v; want %v", n, len(want))
- }
-}