MCPcopy
hub / github.com/CodisLabs/codis / TestReadBytes

Function TestReadBytes

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

Source from the content-addressed store, hash-verified

50}
51
52func TestReadBytes(t *testing.T) {
53 var b bytes.Buffer
54 for i := 0; i < 10; i++ {
55 fmt.Fprintf(&b, "hello world %d ", i)
56 }
57 var input = b.String()
58 for n := 1; n < len(input); n++ {
59 r := newReader(n, input)
60 var s string
61 for i := 0; i < 30; i++ {
62 b, err := r.ReadBytes(' ')
63 assert.MustNoError(err)
64 s += string(b)
65 }
66 assert.Must(s == input)
67 }
68}
69
70func TestReadFull(t *testing.T) {
71 var b bytes.Buffer

Callers

nothing calls this directly

Calls 3

newReaderFunction · 0.85
ReadBytesMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected