(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestByteBufferReset(t *testing.T) { |
| 45 | bytes := &ByteBuffer{quota: 10} |
| 46 | buf := bytes.Use(10) |
| 47 | if len(buf) != 10 || len(bytes.Bytes()) != 10 { |
| 48 | t.Error("Use函数处理不正确") |
| 49 | } |
| 50 | bytes.Reset() |
| 51 | if len(bytes.Bytes()) != 0 { |
| 52 | t.Error("Reset函数处理不正确") |
| 53 | } |
| 54 | } |