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

Function TestGrowOverflow

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

Source from the content-addressed store, hash-verified

503}
504
505func TestGrowOverflow(t *testing.T) {
506 defer func() {
507 if err := recover(); err != bytes.ErrTooLarge {
508 t.Errorf("after too-large Grow, recover() = %v; want %v", err, bytes.ErrTooLarge)
509 }
510 }()
511
512 buf := NewBuffer(make([]byte, 1))
513 const maxInt = int(^uint(0) >> 1)
514 buf.Grow(maxInt)
515}
516
517// Was a bug: used to give EOF reading empty slice at EOF.
518func TestReadEmptyAtEOF(t *testing.T) {

Callers

nothing calls this directly

Calls 2

GrowMethod · 0.95
NewBufferFunction · 0.85

Tested by

no test coverage detected