MCPcopy
hub / github.com/redis/go-redis / TestReader_ReadStringInto_Error

Function TestReader_ReadStringInto_Error

internal/proto/reader_test.go:308–318  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

306}
307
308func TestReader_ReadStringInto_Error(t *testing.T) {
309 r := proto.NewReader(bytes.NewReader([]byte("-ERR something bad\r\n")))
310 buf := make([]byte, 16)
311 _, err := r.ReadStringInto(buf)
312 if err == nil {
313 t.Fatal("expected error, got nil")
314 }
315 if err == proto.Nil {
316 t.Fatalf("got proto.Nil, want ERR")
317 }
318}
319
320func TestReader_ReadStringInto_BufferTooSmall(t *testing.T) {
321 // Feed two consecutive bulk-string replies. The first read uses a

Callers

nothing calls this directly

Calls 2

ReadStringIntoMethod · 0.95
NewReaderFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…