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

Function TestRead

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

Source from the content-addressed store, hash-verified

18}
19
20func TestRead(t *testing.T) {
21 var b bytes.Buffer
22 for i := 0; i < 10; i++ {
23 fmt.Fprintf(&b, "hello world %d", i)
24 }
25 var input = b.String()
26 for n := 1; n < len(input); n++ {
27 r := newReader(n, input)
28 b := make([]byte, len(input))
29 _, err := io.ReadFull(r, b)
30 assert.MustNoError(err)
31 assert.Must(string(b) == input)
32 }
33}
34
35func TestReadByte(t *testing.T) {
36 var input = "hello world"

Callers

nothing calls this directly

Calls 3

newReaderFunction · 0.85
ReadFullMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected