1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-18 02:16:10 -05:00
v2fly/common/buf/reader_test.go
Darien Raymond f506a39d32
multi buffer
2017-04-15 21:07:23 +02:00

22 lines
381 B
Go

package buf_test
import (
"bytes"
"testing"
. "v2ray.com/core/common/buf"
"v2ray.com/core/testing/assert"
)
func TestAdaptiveReader(t *testing.T) {
assert := assert.On(t)
rawContent := make([]byte, 1024*1024)
buffer := bytes.NewBuffer(rawContent)
reader := NewReader(buffer)
b, err := reader.Read()
assert.Error(err).IsNil()
assert.Int(b.Len()).Equals(32 * 1024)
}