MCPcopy Create free account
hub / github.com/Edgio/vflow / TestReadN

Function TestReadN

reader/reader_test.go:86–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestReadN(t *testing.T) {
87 b := []byte{0x05, 0x11, 0x01, 0x16}
88
89 r := NewReader(b)
90 i, err := r.Read(2)
91 if err != nil {
92 t.Error("unexpected error happened, got", err)
93 }
94
95 if !reflect.DeepEqual(i, []byte{0x05, 0x11}) {
96 t.Error("expect read [5 17], got", i)
97 }
98}
99
100func TestReadCount(t *testing.T) {
101 b := make([]byte, 18)

Callers

nothing calls this directly

Calls 2

ReadMethod · 0.95
NewReaderFunction · 0.85

Tested by

no test coverage detected