1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-06 01:05:35 -05:00

multi buffer

This commit is contained in:
Darien Raymond
2017-04-15 21:07:23 +02:00
parent 0ef9143ffd
commit f506a39d32
29 changed files with 390 additions and 297 deletions

View File

@@ -15,14 +15,7 @@ func TestAdaptiveReader(t *testing.T) {
buffer := bytes.NewBuffer(rawContent)
reader := NewReader(buffer)
b1, err := reader.Read()
b, err := reader.Read()
assert.Error(err).IsNil()
assert.Bool(b1.IsFull()).IsTrue()
assert.Int(b1.Len()).Equals(Size)
assert.Int(buffer.Len()).Equals(cap(rawContent) - Size)
b2, err := reader.Read()
assert.Error(err).IsNil()
assert.Bool(b2.IsFull()).IsTrue()
assert.Int(buffer.Len()).Equals(1007616)
assert.Int(b.Len()).Equals(32 * 1024)
}