(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestBuffer_Bytes(t *testing.T) { |
| 28 | t.Parallel() |
| 29 | var b Buffer |
| 30 | _, _ = b.Write([]byte("hello")) |
| 31 | |
| 32 | got := b.Bytes() |
| 33 | assert.Equal(t, []byte("hello"), got) |
| 34 | |
| 35 | // Mutating the returned slice must not affect the buffer. |
| 36 | got[0] = 'H' |
| 37 | assert.Equal(t, "hello", b.String()) |
| 38 | } |
| 39 | |
| 40 | func TestBuffer_Len(t *testing.T) { |
| 41 | t.Parallel() |