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

Function TestReadEmptyAtEOF

syncio/buffer_test.go:518–528  ·  view source on GitHub ↗

Was a bug: used to give EOF reading empty slice at EOF.

(t *testing.T)

Source from the content-addressed store, hash-verified

516
517// Was a bug: used to give EOF reading empty slice at EOF.
518func TestReadEmptyAtEOF(t *testing.T) {
519 b := new(Buffer)
520 slice := make([]byte, 0)
521 n, err := b.Read(slice)
522 if err != nil {
523 t.Errorf("read error: %v", err)
524 }
525 if n != 0 {
526 t.Errorf("wrong count; got %d want 0", n)
527 }
528}
529
530func TestUnreadByte(t *testing.T) {
531 b := new(Buffer)

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected