MCPcopy
hub / github.com/grpc/grpc-go / TestBufferSlice_ReadAll_Reads

Method TestBufferSlice_ReadAll_Reads

mem/buffer_slice_test.go:169–365  ·  view source on GitHub ↗

TestBufferSlice_ReadAll_Reads exercises ReadAll by allowing it to read various combinations of data, empty data, EOF.

(t *testing.T)

Source from the content-addressed store, hash-verified

167// TestBufferSlice_ReadAll_Reads exercises ReadAll by allowing it to read
168// various combinations of data, empty data, EOF.
169func (s) TestBufferSlice_ReadAll_Reads(t *testing.T) {
170 testcases := []struct {
171 name string
172 reads []readStep
173 wantErr string
174 wantBufs int
175 }{
176 {
177 name: "EOF",
178 reads: []readStep{
179 {
180 err: io.EOF,
181 },
182 },
183 },
184 {
185 name: "data,EOF",
186 reads: []readStep{
187 {
188 n: minReadSize,
189 },
190 {
191 err: io.EOF,
192 },
193 },
194 wantBufs: 1,
195 },
196 {
197 name: "data+EOF",
198 reads: []readStep{
199 {
200 n: minReadSize,
201 err: io.EOF,
202 },
203 },
204 wantBufs: 1,
205 },
206 {
207 name: "0,data+EOF",
208 reads: []readStep{
209 {},
210 {
211 n: minReadSize,
212 err: io.EOF,
213 },
214 },
215 wantBufs: 1,
216 },
217 {
218 name: "0,data,EOF",
219 reads: []readStep{
220 {},
221 {
222 n: minReadSize,
223 },
224 {
225 err: io.EOF,
226 },

Callers

nothing calls this directly

Calls 8

ReadAllFunction · 0.92
MaterializeMethod · 0.80
ErrorMethod · 0.65
FatalfMethod · 0.65
FatalMethod · 0.65
EqualMethod · 0.65
LenMethod · 0.65
FreeMethod · 0.65

Tested by

no test coverage detected