MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / TestBodyCallbackReaderCountsReads

Function TestBodyCallbackReaderCountsReads

tools/copycallback_test.go:76–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestBodyCallbackReaderCountsReads(t *testing.T) {
77 br := NewByteBodyWithCallback([]byte{0x1, 0x2, 0x3, 0x4}, 4, nil)
78
79 assert.EqualValues(t, 0, br.readSize)
80
81 p := make([]byte, 8)
82 n, err := br.Read(p)
83
84 assert.Equal(t, 4, n)
85 assert.Nil(t, err)
86 assert.EqualValues(t, 4, br.readSize)
87}
88
89func TestBodyCallbackReaderUpdatesOffsetOnSeek(t *testing.T) {
90 br := NewByteBodyWithCallback([]byte{0x1, 0x2, 0x3, 0x4}, 4, nil)

Callers

nothing calls this directly

Calls 3

NewByteBodyWithCallbackFunction · 0.85
ReadMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected