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

Function TestReader_ReadStringInto_Int

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

Source from the content-addressed store, hash-verified

222}
223
224func TestReader_ReadStringInto_Int(t *testing.T) {
225 r := proto.NewReader(bytes.NewReader([]byte(":42\r\n")))
226 buf := make([]byte, 16)
227 n, err := r.ReadStringInto(buf)
228 if err != nil {
229 t.Fatalf("ReadStringInto: %v", err)
230 }
231 if string(buf[:n]) != "42" {
232 t.Fatalf("got %q, want %q", buf[:n], "42")
233 }
234}
235
236func TestReader_ReadStringInto_Float(t *testing.T) {
237 r := proto.NewReader(bytes.NewReader([]byte(",3.14\r\n")))

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…