MCPcopy Create free account
hub / github.com/djherbis/buffer / TestSpill

Function TestSpill

buffer_test.go:367–375  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

365}
366
367func TestSpill(t *testing.T) {
368 buf := NewSpill(New(5), Discard)
369 buf.Write([]byte("Hello World"))
370 data := make([]byte, 12)
371 n, _ := buf.Read(data)
372 if !bytes.Equal(data[:n], []byte("Hello")) {
373 t.Error("ReadAt Failed. " + string(data[:n]))
374 }
375}
376
377func TestSpill2(t *testing.T) {
378 buf := NewSpill(New(5), nil)

Callers

nothing calls this directly

Calls 4

NewSpillFunction · 0.85
NewFunction · 0.85
WriteMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…