MCPcopy Create free account
hub / github.com/Shopify/goose / empty

Function empty

syncio/buffer_test.go:101–117  ·  view source on GitHub ↗

Empty buf through repeated reads into fub. The initial contents of buf corresponds to the string s.

(t *testing.T, testname string, buf *Buffer, s string, fub []byte)

Source from the content-addressed store, hash-verified

99// Empty buf through repeated reads into fub.
100// The initial contents of buf corresponds to the string s.
101func empty(t *testing.T, testname string, buf *Buffer, s string, fub []byte) {
102 check(t, testname+" (empty 1)", buf, s)
103
104 for {
105 n, err := buf.Read(fub)
106 if n == 0 {
107 break
108 }
109 if err != nil {
110 t.Errorf(testname+" (empty 2): err should always be nil, found err == %s", err)
111 }
112 s = s[n:]
113 check(t, testname+" (empty 3)", buf, s)
114 }
115
116 check(t, testname+" (empty 4)", buf, "")
117}
118
119func TestBasicOperations(t *testing.T) {
120 var buf Buffer

Callers 8

TestBasicOperationsFunction · 0.85
TestLargeStringWritesFunction · 0.85
TestLargeByteWritesFunction · 0.85
TestLargeStringReadsFunction · 0.85
TestLargeByteReadsFunction · 0.85
TestMixedReadsAndWritesFunction · 0.85
TestReadFromFunction · 0.85
TestWriteToFunction · 0.85

Calls 2

checkFunction · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected