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

Function TestNoSpill

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

Source from the content-addressed store, hash-verified

394}
395
396func TestNoSpill(t *testing.T) {
397 buf := NewSpill(New(1024), nil)
398 buf.Write([]byte("Hello World"))
399 data := make([]byte, 12)
400 n, _ := buf.Read(data)
401 if !bytes.Equal(data[:n], []byte("Hello World")) {
402 t.Error("Read Failed. " + string(data[:n]))
403 }
404}
405
406func TestFile(t *testing.T) {
407 file, err := ioutil.TempFile("", "buffer")

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…