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

Function TestCapWithPreallocatedSlice

syncio/buffer_test.go:245–251  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

243}
244
245func TestCapWithPreallocatedSlice(t *testing.T) {
246 buf := NewBuffer(make([]byte, 10))
247 n := buf.Cap()
248 if n != 10 {
249 t.Errorf("expected 10, got %d", n)
250 }
251}
252
253func TestCapWithSliceAndWrittenData(t *testing.T) {
254 buf := NewBuffer(make([]byte, 0, 10))

Callers

nothing calls this directly

Calls 2

CapMethod · 0.95
NewBufferFunction · 0.85

Tested by

no test coverage detected