(t *testing.T)
| 393 | } |
| 394 | |
| 395 | func TestLinkBufferResetTail(t *testing.T) { |
| 396 | except := byte(1) |
| 397 | |
| 398 | LinkBufferCap = 8 |
| 399 | buf := NewLinkBuffer() |
| 400 | |
| 401 | // 1. slice reader |
| 402 | buf.WriteByte(except) |
| 403 | buf.Flush() |
| 404 | r1, _ := buf.Slice(1) |
| 405 | t.Logf("1: %x\n", buf.flush.buf) |
| 406 | // 2. release & reset tail |
| 407 | buf.resetTail(LinkBufferCap) |
| 408 | buf.WriteByte(byte(2)) |
| 409 | t.Logf("2: %x\n", buf.flush.buf) |
| 410 | |
| 411 | // check slice reader |
| 412 | got, _ := r1.ReadByte() |
| 413 | Equal(t, got, except) |
| 414 | } |
| 415 | |
| 416 | func TestLinkBufferWriteBuffer(t *testing.T) { |
| 417 | buf1 := NewLinkBuffer() |
nothing calls this directly
no test coverage detected
searching dependent graphs…