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

Function TestReadByte

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

Source from the content-addressed store, hash-verified

33}
34
35func TestReadByte(t *testing.T) {
36 var input = "hello world"
37 for n := 1; n < len(input); n++ {
38 r := newReader(n, input)
39 var s string
40 for i := 0; i < len(input); i++ {
41 b1, err := r.PeekByte()
42 assert.MustNoError(err)
43 b2, err := r.ReadByte()
44 assert.MustNoError(err)
45 assert.Must(b1 == b2)
46 s += string(b1)
47 }
48 assert.Must(s == input)
49 }
50}
51
52func TestReadBytes(t *testing.T) {
53 var b bytes.Buffer

Callers

nothing calls this directly

Calls 3

newReaderFunction · 0.85
PeekByteMethod · 0.80
ReadByteMethod · 0.80

Tested by

no test coverage detected