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

Function TestBadPartition

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

Source from the content-addressed store, hash-verified

608}
609
610func TestBadPartition(t *testing.T) {
611 p := NewPool(func() Buffer { return badBuffer{} })
612 buf := NewPartition(p)
613 _, err := buf.Write([]byte("bad write"))
614 if err != io.ErrShortBuffer {
615 t.Errorf("wrong read error was returned! %v", err)
616 }
617
618 b := make([]byte, 1024)
619 _, err = buf.Read(b)
620 if err != io.ErrUnexpectedEOF {
621 t.Errorf("wrong write error was returned! %v", err)
622 }
623}
624
625type fakeFile struct {
626 name string

Callers

nothing calls this directly

Calls 4

NewPoolFunction · 0.85
NewPartitionFunction · 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…