//go:build xturbo_poison package xturbo import "testing" func TestPoisonFlushedBytes(t *testing.T) { w, _ := socketpair(t) b := NewBuf(0) fill(b, 2000, 60) retained := b.b[:4] if err := b.flush(w); err != ErrWouldBlock { t.Fatal(err) } for _, v := range retained { if v != 0xa5 { t.Fatal("flushed bytes must be poisoned") } } for _, v := range b.Bytes()[:4] { if v == 0xa5 { t.Fatal("pending bytes poisoned") } } }