TestHeadTailBufferSmallOutputUntouched: output under the head cap must come back byte-identical - the bounding must be invisible in the normal case.
(t *testing.T)
| 72 | |
| 73 | // TestHeadTailBufferSmallOutputUntouched: output under the head cap must come |
| 74 | // back byte-identical - the bounding must be invisible in the normal case. |
| 75 | func TestHeadTailBufferSmallOutputUntouched(t *testing.T) { |
| 76 | var b headTailBuffer |
| 77 | b.Write([]byte("hello ")) |
| 78 | b.Write([]byte("world")) |
| 79 | if got := b.String(); got != "hello world" { |
| 80 | t.Fatalf("small output mangled: %q", got) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | // TestHeadTailBufferKeepsExactHeadAndTail: once the middle is dropped, the |