MCPcopy Index your code
hub / github.com/CodisLabs/codis / TestReadFull

Function TestReadFull

pkg/utils/bufio2/bufio_test.go:70–82  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

68}
69
70func TestReadFull(t *testing.T) {
71 var b bytes.Buffer
72 for i := 0; i < 10; i++ {
73 fmt.Fprintf(&b, "hello world %d ", i)
74 }
75 var input = b.String()
76 for n := 1; n < len(input); n++ {
77 r := newReader(n, input)
78 b, err := r.ReadFull(len(input))
79 assert.MustNoError(err)
80 assert.Must(string(b) == input)
81 }
82}
83
84func newWriter(n int, b *bytes.Buffer) *Writer {
85 return &Writer{wr: b, buf: make([]byte, n)}

Callers

nothing calls this directly

Calls 3

newReaderFunction · 0.85
ReadFullMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected