aboutsummaryrefslogtreecommitdiff
path: root/bytesconv_timing_test.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2022-04-01 18:11:16 +0200
committerGravatar GitHub <noreply@github.com> 2022-04-01 18:11:16 +0200
commit7a5afddf5b805a022f8e81281c772c11600da2f4 (patch)
tree76ecbf4981921328d823eb925e57f874f52c34f2 /bytesconv_timing_test.go
parentsupport adding/removing clients from LBClient (#1243) (diff)
downloadfasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.gz
fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.tar.bz2
fasthttp-7a5afddf5b805a022f8e81281c772c11600da2f4.zip
Use %v for errors and %q for strings (#1262)v1.35.0
Mostly in tests.
Diffstat (limited to 'bytesconv_timing_test.go')
-rw-r--r--bytesconv_timing_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/bytesconv_timing_test.go b/bytesconv_timing_test.go
index 34795df..334376a 100644
--- a/bytesconv_timing_test.go
+++ b/bytesconv_timing_test.go
@@ -18,7 +18,7 @@ func BenchmarkAppendHTMLEscape(b *testing.B) {
for i := 0; i < 10; i++ {
buf = AppendHTMLEscape(buf[:0], sOrig)
if string(buf) != sExpected {
- b.Fatalf("unexpected escaped string: %s. Expecting %s", buf, sExpected)
+ b.Fatalf("unexpected escaped string: %q. Expecting %q", buf, sExpected)
}
}
}
@@ -34,7 +34,7 @@ func BenchmarkHTMLEscapeString(b *testing.B) {
for i := 0; i < 10; i++ {
s = html.EscapeString(sOrig)
if s != sExpected {
- b.Fatalf("unexpected escaped string: %s. Expecting %s", s, sExpected)
+ b.Fatalf("unexpected escaped string: %q. Expecting %q", s, sExpected)
}
}
}
@@ -49,7 +49,7 @@ func BenchmarkParseIPv4(b *testing.B) {
for pb.Next() {
ip, err = ParseIPv4(ip, ipStr)
if err != nil {
- b.Fatalf("unexpected error: %s", err)
+ b.Fatalf("unexpected error: %v", err)
}
}
})
@@ -88,10 +88,10 @@ func BenchmarkParseUint(b *testing.B) {
for pb.Next() {
n, err := ParseUint(buf)
if err != nil {
- b.Fatalf("unexpected error: %s", err)
+ b.Fatalf("unexpected error: %v", err)
}
if n != 1234567 {
- b.Fatalf("unexpected result: %d. Expecting %s", n, buf)
+ b.Fatalf("unexpected result: %d. Expecting %q", n, buf)
}
}
})