(t *testing.T)
| 201 | } |
| 202 | |
| 203 | func TestStreamSize(t *testing.T) { |
| 204 | s := NewStream() |
| 205 | |
| 206 | if s.Size() != 0 { |
| 207 | t.Error("size is", s.Size()) |
| 208 | } |
| 209 | |
| 210 | size := 1024 * 32 |
| 211 | b := make([]byte, size) |
| 212 | write(t, s, b) |
| 213 | |
| 214 | if s.Size() != size { |
| 215 | t.Error("size should be", size, "instead is", s.Size()) |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | func BenchmarkStreamWrite(b *testing.B) { |
| 220 | b.ReportAllocs() |