(t *testing.T)
| 21 | ) |
| 22 | |
| 23 | func TestByteBufferUse(t *testing.T) { |
| 24 | bytes := &ByteBuffer{quota: 10} |
| 25 | buf := bytes.Use(10) |
| 26 | if len(buf) != 10 || len(bytes.Bytes()) != 10 { |
| 27 | t.Error("Use函数处理不正确") |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | func TestByteBufferUseTwice(t *testing.T) { |
| 32 | bytes := &ByteBuffer{quota: 10} |