1
0
mirror of https://github.com/redis/go-redis.git synced 2025-11-05 14:10:37 +03:00

chore(tests): internal/proto/peek_push_notification_test : Refactor test helpers to… (#3563)

* internal/proto/peek_push_notification_test : Refactor test helpers to use fmt.Fprintf for buffers

Replaced buf.WriteString(fmt.Sprintf(...)) with fmt.Fprintf or fmt.Fprint in test helper functions for improved clarity and efficiency. This change affects push notification and RESP3 test utilities.

* peek_push_notification_test: revert prev formatting

* all: replace buf.WriteString with fmt.FprintF for consistency

---------

Co-authored-by: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com>
This commit is contained in:
iliya
2025-10-28 18:41:45 +09:00
committed by GitHub
parent 7be00c8725
commit 9c77386b08
3 changed files with 39 additions and 37 deletions

View File

@@ -2,6 +2,7 @@ package proto_test
import (
"bytes"
"fmt"
"io"
"testing"
@@ -86,7 +87,7 @@ func TestReader_ReadLine(t *testing.T) {
func benchmarkParseReply(b *testing.B, reply string, wanterr bool) {
buf := new(bytes.Buffer)
for i := 0; i < b.N; i++ {
buf.WriteString(reply)
fmt.Fprint(buf, reply)
}
p := proto.NewReader(buf)
b.ResetTimer()