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

Method TestBuffer_SliceEmpty

mem/buffers_test.go:402–413  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

400}
401
402func (s) TestBuffer_SliceEmpty(t *testing.T) {
403 allCtors := append(slices.Clip(ctors), namedCtor{name: "empty", newBuf: newEmptyBuf})
404 for _, c := range allCtors {
405 t.Run(c.name, func(t *testing.T) {
406 buf := c.newBuf([]byte{1, 2, 3, 4})
407 got := buf.Slice(0, 0)
408 if !bytes.Equal(got.ReadOnlyData(), nil) {
409 t.Fatalf("Buffer did not contain expected data. got %v, want %v", got.ReadOnlyData(), nil)
410 }
411 })
412 }
413}
414
415func (s) TestBuffer_SliceBoundsCheck(t *testing.T) {
416 type panicCase struct {

Callers

nothing calls this directly

Calls 4

SliceMethod · 0.65
EqualMethod · 0.65
ReadOnlyDataMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected